public void AddIncorrectCity()
        {
            var mock = new Mock <IPeopleDao>();

            mock.Setup(item => item.Add(It.IsAny <Person>())).Returns(7);
            var logic = new PeopleLogic(mock.Object);

            logic.Add("Eldar", "Petrov", new DateTime(1993, 12, 27), 25,
                      "Om5sk", "50 years of October", "51b");
        }
        public void AddNullName()
        {
            var mock = new Mock <IPeopleDao>();

            mock.Setup(item => item.Add(It.IsAny <Person>())).Returns(7);
            var logic = new PeopleLogic(mock.Object);

            id = logic.Add(null, "Petrov", new DateTime(1993, 12, 27), 25,
                           "Omsk", "50 years of October", "51b");
        }
        public void AddNullStreet()
        {
            var mock = new Mock <IPeopleDao>();

            mock.Setup(item => item.Add(It.IsAny <Person>())).Returns(7);
            var logic = new PeopleLogic(mock.Object);

            logic.Add("Eldar", "Petrov", new DateTime(1993, 12, 27), 25,
                      "Omsk", null, "51b");
        }
Exemplo n.º 4
0
        public void AddIncorrectCity()
        {
            var mock = new Mock <IPersonDao>();

            mock.Setup(item => item.Add(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <DateTime>(),
                                        It.IsAny <int>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>())).Returns(4);

            var logic = new PeopleLogic(mock.Object);

            id = logic.Add("Alex", "Pak", new DateTime(1997, 11, 05), 21,
                           "Saratov53535", "Chapaeva", "60");
        }
Exemplo n.º 5
0
        public void AddNullNumberOfHouse()
        {
            var mock = new Mock <IPersonDao>();

            mock.Setup(item => item.Add(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <DateTime>(),
                                        It.IsAny <int>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>())).Returns(4);

            var logic = new PeopleLogic(mock.Object);

            id = logic.Add("Alex", "Pak", new DateTime(1997, 11, 05), 21,
                           "Saratov", "Chapaeva", null);
        }
        public void CorrectDataAdding()
        {
            var mock = new Mock <IPeopleDao>();

            mock.Setup(item => item.Add(It.IsAny <Person>())).Returns(7);
            var logic = new PeopleLogic(mock.Object);


            id = logic.Add("Eldar", "Petrov", new DateTime(1993, 12, 27), 25,
                           "Omsk", "50 years of October", "51b");

            Assert.AreEqual(id, 7, "Method Add doesn't work");
        }
Exemplo n.º 7
0
        public void AddingCorrect()
        {
            var mock = new Mock <IPersonDao>();

            mock.Setup(item => item.Add(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <DateTime>(),
                                        It.IsAny <int>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>())).Returns(4);

            var logic = new PeopleLogic(mock.Object);

            id = logic.Add("Alex", "Pak", new DateTime(1997, 11, 05), 21,
                           "Saratov", "Chapaeva", "60");

            Assert.AreEqual(id, 4, "Error adding");
        }