public IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
 {
     publisher_name = RPValidations.Capitalize(publisher_name, true);
     contact_name   = RPValidations.Capitalize(contact_name, true);
     contact_phone  = RPValidations.FormatPhoneNumber(contact_phone);
     yield return(ValidationResult.Success);
 }
Ejemplo n.º 2
0
 public IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
 {
     street_address = RPValidations.Capitalize(street_address, true);
     city           = RPValidations.Capitalize(city, true);
     postal_code    = RPValidations.FormatPostalCode(postal_code);
     yield return(ValidationResult.Success);
 }
Ejemplo n.º 3
0
 public IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
 {
     first_name = RPValidations.Capitalize(first_name, true);
     last_name  = RPValidations.Capitalize(last_name, true);
     gender     = RPValidations.Capitalize(gender, false);
     phone      = RPValidations.FormatPhoneNumber(phone);
     yield return(ValidationResult.Success);
 }
Ejemplo n.º 4
0
 public IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
 {
     genre_name = RPValidations.Capitalize(genre_name, true);
     if (!String.IsNullOrWhiteSpace(description))
     {
         description = RPValidations.CapitalizeSentences(description);
     }
     yield return(ValidationResult.Success);
 }
Ejemplo n.º 5
0
 public IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
 {
     first_name = RPValidations.Capitalize(first_name, true);
     last_name  = RPValidations.Capitalize(last_name, true);
     gender     = RPValidations.Capitalize(gender, false);
     phone      = RPValidations.FormatPhoneNumber(phone);
     if (date_joined == DateTime.Parse("0001-01-01"))
     {
         date_joined = DateTime.Today;
     }
     yield return(ValidationResult.Success);
 }
 public IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
 {
     developer_name = RPValidations.Capitalize(developer_name, true);
     if (!string.IsNullOrWhiteSpace(contact_name))
     {
         contact_name = RPValidations.Capitalize(contact_name, true);
     }
     if (!string.IsNullOrWhiteSpace(contact_phone))
     {
         contact_phone = RPValidations.FormatPhoneNumber(contact_phone);
     }
     yield return(ValidationResult.Success);
 }
Ejemplo n.º 7
0
        // This test is responsible for checking the Genre Name validation (value in lowercase characters)
        public void GenreTest_Validation_NameLowerCase_ShouldCapitalizeFirstLetters()
        {
            // Arrange
            Genre  genre     = new Genre();
            string genreName = RPValidations.Capitalize("action", true);
            string expected  = "Action";

            // Act
            genre.genre_name = genreName;

            // Assert
            string actual = genre.genre_name;

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 8
0
        // This test is responsible for checking the Contact Name validation (value in lowercase characters)
        public void PublisherTest_Validation_ContactNameLowerCase_ShouldCapitalizeFirstLetterOfEachWord()
        {
            // Arrange
            Publisher publisher   = new Publisher();
            string    contactName = RPValidations.Capitalize("frank sinatra", true);
            string    expected    = "Frank Sinatra";

            // Act
            publisher.contact_name = contactName;

            // Assert
            string actual = publisher.contact_name;

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 9
0
        // This test is responsible for checking the Store Event Name validation (value in lowercase characters)
        public void Store_EventTest_Validation_NameLowerCase_ShouldCapitalizeFirstLetters()
        {
            // Arrange
            Store_Event storeEvent = new Store_Event();
            string      eventName  = RPValidations.Capitalize("best sale ever", true);
            string      expected   = "Best Sale Ever";

            // Act
            storeEvent.store_event_name = eventName;

            // Assert
            string actual = storeEvent.store_event_name;

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 10
0
        // This test is responsible for checking the Contact Name validation (value in lowercase characters)
        public void DeveloperTest_Validation_ContactNameLowerCase_ShouldCapitalizeFirstLetterOfEachWord()
        {
            // Arrange
            Developer developer   = new Developer();
            string    contactName = RPValidations.Capitalize("homer simpson", true);
            string    expected    = "Homer Simpson";

            // Act
            developer.contact_name = contactName;

            // Assert
            string actual = developer.contact_name;

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 11
0
        // This test is responsible for checking the Game Name validation (value in lowercase characters)
        public void GameTest_Validation_NameLowerCase_ShouldCapitalizeFirstLetters()
        {
            // Arrange
            Game   game     = new Game();
            string gameName = RPValidations.Capitalize("the legend of zelda", true);
            string expected = "The Legend Of Zelda";

            // Act
            game.game_name = gameName;

            // Assert
            string actual = game.game_name;

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 12
0
        // This test is responsible for checking the Street Address validation (value in lowercase characters)
        public void AddressTest_Validation_AddressWithLowerCase_ShouldMakeFirstLetterOfEachWord()
        {
            // Arrange
            Address address  = new Address();
            string  address1 = RPValidations.Capitalize("202 hello hello st", true);
            string  expected = "202 Hello Hello St";

            // Act
            address.street_address = address1;

            // Assert
            string actual = address.street_address;

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 13
0
        // This test is responsible for checking the Last Name validation (value in lowercase characters)
        public void UserTest_Validation_LastNameLowerCase_ShouldCapitalizeFirstLetter()
        {
            // Arrange
            User   user     = new User();
            string lastName = RPValidations.Capitalize("jenkins", false);
            string expected = "Jenkins";

            // Act
            user.last_name = lastName;

            // Assert
            string actual = user.last_name;

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 14
0
        // This test is responsible for checking the First Name validation (value in lowercase characters)
        public void UserTest_Validation_FirstNameLowerCase_ShouldCapitalizeFirstLetter()
        {
            // Arrange
            User   user      = new User();
            string firstName = RPValidations.Capitalize("leroy", false);
            string expected  = "Leroy";

            // Act
            user.first_name = firstName;

            // Assert
            string actual = user.first_name;

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 15
0
 public IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
 {
     game_name   = RPValidations.Capitalize(game_name, true);
     description = RPValidations.CapitalizeSentences(description);
     yield return(ValidationResult.Success);
 }