Пример #1
0
        public void CreateSignRepositoryTest()
        {
            var repositoryDiTestClass = new SignRepositoryDiTestClass();
            var signs = repositoryDiTestClass.GetSigns();

            Assert.IsNotNull(signs);
        }
Пример #2
0
        public void CreateSignMockRepositoryTest()
        {
            var signs = new List <Sign>
            {
                new Sign {
                    SignId = 1, AccountId = 101
                },
                new Sign {
                    SignId = 2, AccountId = 102
                }
            };
            var mockSignRepository = new Mock <ISignRepository>();

            mockSignRepository.Setup(obj => obj.Get()).Returns(signs);
            var signRepositoryDiTestClass = new SignRepositoryDiTestClass(mockSignRepository.Object);
            var result = signRepositoryDiTestClass.GetSigns();

            Assert.IsTrue(signs == result);
        }