Skip to content

Commit 2587bd6

Browse files
committed
update : repo/service 반환값 검사하는 테스트로 수정
1 parent 1988f7f commit 2587bd6

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

test/AzureOpenAIProxy.ApiApp.Tests/Repositories/AdminEventRepositoryTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void Given_Null_StorageAccountSettings_When_Creating_AdminEventRepository
5858
}
5959

6060
[Fact]
61-
public async Task Given_Instance_When_CreateEvent_Invoked_Then_It_Should_Not_Throw_Exception()
61+
public async Task Given_Instance_When_CreateEvent_Invoked_Then_It_Should_Return_Passed_Argument()
6262
{
6363
// Arrange
6464
var settings = Substitute.For<StorageAccountSettings>();
@@ -70,11 +70,11 @@ public async Task Given_Instance_When_CreateEvent_Invoked_Then_It_Should_Not_Thr
7070
var eventDetails = new AdminEventDetails();
7171
var repository = new AdminEventRepository(tableServiceClient, settings);
7272

73-
// Act
74-
Func<Task> func = () => repository.CreateEvent(eventDetails);
73+
// Act
74+
var result = await repository.CreateEvent(eventDetails);
7575

7676
// Assert
77-
await func.Should().NotThrowAsync<InvalidOperationException>();
77+
result.Should().BeEquivalentTo(eventDetails);
7878
}
7979

8080
[Fact]

test/AzureOpenAIProxy.ApiApp.Tests/Services/AdminEventServiceTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public void Given_ServiceCollection_When_AddAdminEventService_Invoked_Then_It_Sh
3131
}
3232

3333
[Fact]
34-
public async Task Given_Instance_When_CreateEvent_Invoked_Then_It_Should_Not_Throw_Exception()
34+
public async Task Given_Instance_When_CreateEvent_Invoked_Then_It_Should_Return_Passed_Argument()
3535
{
3636
// Arrange
3737
var eventDetails = new AdminEventDetails();
@@ -42,10 +42,10 @@ public async Task Given_Instance_When_CreateEvent_Invoked_Then_It_Should_Not_Thr
4242
repository.CreateEvent(Arg.Any<AdminEventDetails>()).Returns(eventDetails);
4343

4444
// Act
45-
Func<Task> func = () => service.CreateEvent(eventDetails);
45+
var result = await service.CreateEvent(eventDetails);
4646

4747
// Assert
48-
await func.Should().NotThrowAsync<InvalidOperationException>();
48+
result.Should().BeEquivalentTo(eventDetails);
4949
}
5050

5151
[Fact]

0 commit comments

Comments
 (0)