Slide 15
Slide 15 text
テストコー
ド
public class FooUseCaseTest {
private IApiClient client;
[Test]
public void Run_Success() {
client = new ApiClientMock();
var response = new FooResponse { Foo = "OK" };
client.Mock()
.Success(response);
var useCase = new FooUseCase(client);
Assert.AreEqual("OK", useCase.Run());
}
}
ApiClientMock
を外から流し込めば意図した挙動にな
る