Ejemplo n.º 1
0
        public void Should_FailValidation_When_PhoneNumberIsNull()
        {
            // Arrange
            var restaurantProfileValidator = new RestaurantProfileValidator();
            var restaurantProfile          = new RestaurantProfile()
            {
                PhoneNumber = null,
                Address     = new Address()
                {
                    Street1 = "1250 Bellflower Blvd",
                    City    = "Long Beach",
                    State   = "CA",
                    Zip     = 90840
                },
                GeoCoordinates = new GeoCoordinates()
                {
                    Longitude = 33.7838,
                    Latitude  = -118.1141
                }
            };

            // Act
            var result  = restaurantProfileValidator.Validate(restaurantProfile, ruleSet: "CreateUser");
            var isValid = result.IsValid;

            // Assert
            isValid.Should().Be(false);
        }
Ejemplo n.º 2
0
        public void Should_FailValidation_When_LatitudeIsEmpty()
        {
            // Arrange
            var restaurantProfileValidator = new RestaurantProfileValidator();
            var restaurantProfile          = new RestaurantProfile()
            {
                PhoneNumber    = "(562)985-4111",
                Address        = null,
                GeoCoordinates = new GeoCoordinates()
                {
                    Longitude = 33.7838
                }
            };

            // Act
            var result  = restaurantProfileValidator.Validate(restaurantProfile, ruleSet: "CreateUser");
            var isValid = result.IsValid;

            // Assert
            isValid.Should().Be(false);
        }