示例#1
0
        public void Test2()
        {
            // Arrange
            var customer = new Customer
            {
                Id   = 3,
                Name = ""
            };
            var saveMock  = new SaveMock();
            var validator = new Program.SaveCustomer(saveMock);

            // Act
            var result = validator.SaveAndValidate(customer);

            // Assert
            Assert.True(result);
            Assert.True(saveMock.Get(3) != null);
        }
示例#2
0
        public void Test1()
        {
            // Arrange
            var customer = new Customer
            {
                Id    = 2,
                Email = ""
            };

            var saveMock = new SaveMock();

            var validator = new Program.SaveCustomer(saveMock);

            // Act
            var result = validator.SaveAndValidate(customer);

            // Assert
            Assert.False(result);
            Assert.True(saveMock.Get(2) == null);
        }