示例#1
0
        public void GenerateParkingCode_CodeIncrementing()
        {
            // Arrange
            ParkClient    parkClient   = new ParkClient();
            List <string> parkingCodes = new List <string>();

            // Act
            for (int i = 0; i < 5; i++)
            {
                parkingCodes.Add(parkClient.GenerateParkingCode());
            }
            // Assert
            Assert.NotEqual(parkingCodes[0], parkingCodes[1]);
        }
示例#2
0
        public void CompanyParkingCodeValidation_ValidateParkingCode()
        {
            // Arrange
            string     companyParkingCodeTooShort       = "AAAA";
            string     companyParkingCodeContainsDigits = "AAAA5";
            string     companyParkingCodeCorrect        = "AAAAA";
            ParkClient client = new ParkClient();
            // Act
            Action actOne = () => Validator.CompanyParkingCodeValidation(companyParkingCodeTooShort);
            Action actTwo = () => Validator.CompanyParkingCodeValidation(companyParkingCodeContainsDigits);

            client.CompanyParkingCode = companyParkingCodeCorrect;
            // Assert
            Assert.Throws <ArgumentException>(actOne);
            Assert.Throws <ArgumentException>(actTwo);
            Assert.Equal(companyParkingCodeCorrect, client.CompanyParkingCode);
        }