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);
        }
Exemplo n.º 2
0
 private async void btnCallAPI_Click(object sender, RoutedEventArgs e)
 {
     if (tokenService.IsTokenExist())
     {
         tbStatus.Text = await helloService.Get(tokenService.GetToken());
     }
     else
     {
         tbStatus.Text = "There is no token in the local storage";
     }
 }