Пример #1
0
        public async Task GetAsync_GetFactorialObjectAsync()
        {
            var response = await CreateServiceClient().GetAsync(new GetFactorialObjectAsync {
                ForNumber = Param
            });

            Assert.That(response.Result, Is.EqualTo(FactorialService.GetFactorial(Param)));
        }
Пример #2
0
        public void GetSync_GetFactorialDelayAsync()
        {
            var response = CreateServiceClient().Get(new GetFactorialDelayAsync {
                ForNumber = Param
            });

            Assert.That(response.Result, Is.EqualTo(FactorialService.GetFactorial(Param)));
        }
        public async Task Can_call_GetAsync_on_GetFactorial_using_RestClientAsync()
        {
            var asyncClient = CreateServiceClient();

            var response = await asyncClient.GetAsync <GetFactorialResponse>("factorial/sync/3");

            Assert.That(response, Is.Not.Null, "No response received");
            Assert.That(response.Result, Is.EqualTo(FactorialService.GetFactorial(3)));
        }
Пример #4
0
        public void testFactorialFive()
        {
            //Arrange
            FactorialService factorialService = new FactorialService();
            //Act
            int result = factorialService.Calculate(5);

            //Assert
            Assert.Equal(120, result);
        }
Пример #5
0
        public void TestFactorialZero()
        {
            //Arrange
            FactorialService factorialService = new FactorialService();
            //Act
            int result = factorialService.Calculate(0);

            //Assert
            Assert.Equal(1, result);
        }
 public FactorialService_FactorialShould()
 {
     _factorialService = new FactorialService();
 }
Пример #7
0
 public void TestInit()
 {
     _mockedFactorialComputationService = Substitute.For <IFactorialComputationService>();
     _factorialService = new FactorialService(_mockedFactorialComputationService);
 }