Esempio n. 1
0
        public void TestGetBillsByDate()
        {
            //Data object
            string   id     = "3fadd6a2-cee7-4b93-8763-f5402ce70d30";
            DateTime start  = new DateTime(2017, 1, 1);
            DateTime finish = new DateTime(2017, 1, 17);

            //Get the result
            string actual = billyRepository.GetBillsByDate(id, start, finish);

            string expectedResult = "91";

            Assert.AreEqual(expectedResult, actual);
        }
Esempio n. 2
0
        public void VerifyGetBillsByDate()
        {
            string expectedResult = "91";

            //Setup the mock to return the expected result
            requesterHelperMock.Setup(requester =>
                                      requester.MakeGetRequest(It.IsAny <string>(), It.IsAny <Dictionary <string, string> >())).Returns(expectedResult);

            //Get the result
            string result = repository.GetBillsByDate("", DateTime.Now, DateTime.Now);

            Assert.AreEqual(expectedResult, result);

            //Verify method call
            requesterHelperMock.Verify(x => x.MakeGetRequest(It.IsAny <string>(), It.IsAny <Dictionary <string, string> >()), Times.Once);
        }