Ejemplo n.º 1
0
 public async Task ExecuteTestWithEmptyStringAsyncTest()
 {
     var dataService = A.Fake<IDataService>();
     var sut = new SayHelloWorldAction(dataService);
     
     var result = await sut.ExecuteAsync("");
     
     result.Greeting.Should().Be("Are you sure?");
     A.CallTo(() => dataService.SaveGreetingAsync(A<string>.Ignored)).MustNotHaveHappened();
 }
Ejemplo n.º 2
0
 public async Task ExecuteAsyncTest()
 {
     var dataService = A.Fake<IDataService>();
     var sut = new SayHelloWorldAction(dataService);
     
     var result = await sut.ExecuteAsync("World");
     
     result.Greeting.Should().Be("Hello World!");
     A.CallTo(() => dataService.SaveGreetingAsync(A<string>.Ignored)).MustHaveHappened(Repeated.Exactly.Once);
 }