Exemplo n.º 1
0
        public void EmployeeBaseValidate_AllBad()
        {
            // Arrange
            var employee = new EmployeeCS()
            {
                DocSeries = "1001lkjdfsa",
                DocNumber = "123456dfrg",

                SurName      = "Кирилл1234Кирилл1234Кирилл1234Кирилл1234Кирилл1234!",
                Patronymic   = "ВалерьевичВалерьевичВалерьевичВалерьевичВалерьевич!",
                Position     = "НащальникаНащальникаНащальникаНащальникаНащальника!",
                DepartmentID = Guid.Empty
            };
            // Act
            bool result = false;

            try
            {
                result = employee.Validate();
            }
            catch (AggregateException e)
            {
                // Assert
                Assert.AreEqual(e.InnerExceptions.Count, 8);
                return;
            }
            // Assert
            Assert.Fail();
        }
Exemplo n.º 2
0
        public void EmployeeBaseValidate_AllGood()
        {
            // Arrange
            var employee = new EmployeeCS()
            {
                DateOfBirth  = DateTime.Now,
                DocSeries    = "1001",
                DocNumber    = "123456",
                FirstName    = "Николавев",
                SurName      = "Кирилл",
                Patronymic   = "Валерьевич",
                Position     = "Нащальника",
                DepartmentID = Guid.NewGuid()
            };
            // Act
            bool result = employee.Validate();

            // Assert
            Assert.IsTrue(result);
        }