コード例 #1
0
        public void Any_returns_greeting_with_name()
        {
            var request = new Hello {
                Name = "integration name"
            };

            var mockRequestContext = new MockRequestContext();

            var mockRespository = new Mock <IRepository>();

            mockRespository.Setup(a => a.GetGreeting())
            .Returns(new Greeting {
                Greet = "Hiya"
            });

            var service = new HelloService {
                RequestContext = mockRequestContext,
                Repository     = mockRespository.Object
            };


            HelloResponse response = (HelloResponse)service.Get(request);

            response.Result.Should().Be("Hiya, " + request.Name);
        }
コード例 #2
0
 public void Second_Get()
 {
     var           client   = newClient();
     HelloResponse response = client.Get(new Hello {
         Name = "integration name"
     });
 }