Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,20 @@ public void CreateRoom_WithTimeRangeExceedMax_Fail()
Assert.AreEqual(400, ex?.Status);
}

[Test]
public void CreateRoom_WithPastValidUntil_Fail()
{
// Arrange;
var roomsClient = CreateInstrumentedRoomsClient(RoomsClientOptions.ServiceVersion.V2023_06_14);
var validFrom = DateTime.UtcNow.AddDays(-10);
var validUntil = validFrom.AddDays(-20);

// Act and Assert
RequestFailedException? ex = Assert.ThrowsAsync<RequestFailedException>(async () => await roomsClient.CreateRoomAsync(validFrom: validFrom, validUntil: validUntil));
Assert.NotNull(ex);
Assert.AreEqual(400, ex?.Status);
}

[Test]
public void CreateRoom_WithInvalidParticipantMri_Fail()
{
Expand Down Expand Up @@ -272,6 +286,22 @@ public async Task UpdateRoom_WithTimeRangeExceedMax_Fail()
Assert.AreEqual(400, ex?.Status);
}

[Test]
public async Task UpdateRoom_WithPastValidUntil_Fail()
{
// Arrange
var validFrom = DateTime.UtcNow;
var validUntil = validFrom.AddDays(10);
var roomsClient = CreateInstrumentedRoomsClient(RoomsClientOptions.ServiceVersion.V2023_06_14);
var createRoomResponse = await roomsClient.CreateRoomAsync(validFrom: validFrom, validUntil: validUntil);

// Act and Assert
validUntil = validFrom.AddDays(-20);
RequestFailedException? ex = Assert.ThrowsAsync<RequestFailedException>(async () => await roomsClient.UpdateRoomAsync(createRoomResponse.Value.Id, validFrom: validFrom, validUntil: validUntil));
Assert.NotNull(ex);
Assert.AreEqual(400, ex?.Status);
}

[Test]
public void UpdateRoom_WithInvalidFormatRoomId_Fail()
{
Expand Down Expand Up @@ -626,6 +656,19 @@ public async Task DeleteRoom_Success()
Assert.AreEqual(404, ex?.Status);
}

[Test]
public void DeleteRoomDoesNotExist_Fail()
{
// Arrange
var roomsClient = CreateInstrumentedRoomsClient(RoomsClientOptions.ServiceVersion.V2023_06_14);
var ivnalidRoomId = "99437728598278806";

// Act and Assert:
RequestFailedException? ex = Assert.ThrowsAsync<RequestFailedException>(async () => await roomsClient.DeleteRoomAsync(ivnalidRoomId));
Assert.NotNull(ex);
Assert.AreEqual(404, ex?.Status);
}

private void ValidateRoom(CommunicationRoom? room)
{
Assert.NotNull(room);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading