Exemplo n.º 1
0
        public void Can_Not_Pass_UserValidator_Tests()
        {
            //Arrange
            var user = new User()
            {
                UserName = ""
            };

            //Arrange
            var result = new UserValidator().Validate(user);

            //Assert
            OutputHelpers.WriteLineError(result, outputHelper);
            Assert.False(result.IsValid);
        }
        public void Can_Pass_SoftwareValidator_Tests()
        {
            //Arrange
            var model = new Software()
            {
                SoftwareName        = "TwitterBot",
                SoftwareLastVersion = "v1.20",
            };

            //Action
            var result = new SoftwareValidator().Validate(model);

            //Assert
            OutputHelpers.WriteLineError(result, outputHelper);
            Assert.True(result.IsValid);
        }
        public void Can_Not_Pass_SoftwareValidator_Tests()
        {
            //Arrange
            var model = new Software()
            {
                SoftwareName        = "1234",
                SoftwareLastVersion = "",
            };

            //Action
            var result = new SoftwareValidator().Validate(model);

            //Assert
            OutputHelpers.WriteLineError(result, outputHelper);
            Assert.False(result.IsValid);
        }
        public void Can_Not_Pass_CustomerValidator_Tests()
        {
            //Arrange
            var customer = new Customer()
            {
                CustomerEMail    = "testMail@",
                CustomerIsActive = false,
                CustomerName     = "123",
                CustomerPhone    = "345",
            };

            //Arrange
            var result = new CustomerValidator().Validate(customer);

            //Assert
            OutputHelpers.WriteLineError(result, outputHelper);
            Assert.False(result.IsValid);
        }
        public void Can_Pass_CustomerValidator_Tests()
        {
            //Arrange
            var customer = new Customer()
            {
                CustomerEMail    = "*****@*****.**",
                CustomerIsActive = false,
                CustomerName     = "Enis Kurtay",
                CustomerPhone    = "12312093",
            };

            //Arrange
            var result = new CustomerValidator().Validate(customer);

            //Assert
            OutputHelpers.WriteLineError(result, outputHelper);
            Assert.True(result.IsValid);
        }
Exemplo n.º 6
0
        public void Can_Not_Pass_CustomerComputerInfoValidator_Tests()
        {
            //Arrange
            var customerComputerInfo = new CustomerComputerInfo()
            {
                SubscriptionId = 0,
                CustomerComputerInfoHddSerialCode     = "1234",
                CustomerComputerInfoMacSerialCode     = "1234",
                CustomerComputerInfoProcessSerialCode = "1234",
            };

            //Action
            var result = new CustomerComputerInfoValidator().Validate(customerComputerInfo);

            //Assert
            OutputHelpers.WriteLineError(result, outputHelper);
            Assert.False(result.IsValid);
        }
Exemplo n.º 7
0
        public void Can_Pass_CustomerComputerInfoValidator_Tests()
        {
            //Arrange
            var customerComputerInfo = new CustomerComputerInfo()
            {
                SubscriptionId = 2,
                CustomerComputerInfoHddSerialCode     = "HDDNUMBER123456",
                CustomerComputerInfoMacSerialCode     = "MACNUMBER123456",
                CustomerComputerInfoProcessSerialCode = "PROCESSNUMBER123456",
            };

            //Action
            var result = new CustomerComputerInfoValidator().Validate(customerComputerInfo);

            //Assert
            OutputHelpers.WriteLineError(result, outputHelper);
            Assert.True(result.IsValid);
        }
        public void Can_Not_Pass_SoftwareValidator_Tests()
        {
            //Arrange
            var model = new Subscription()
            {
                SoftwareId               = 0,
                CustomerId               = 0,
                SubScriptionStartDate    = DateTime.Now,
                SubScriptionEndDate      = DateTime.Now,
                SubScriptionLicenceCount = 0,
            };

            //Action
            var result = new SubscriptionValidator().Validate(model);

            //Assert
            OutputHelpers.WriteLineError(result, outputHelper);
            Assert.False(result.IsValid);
        }