コード例 #1
0
        public void MockDefinitionValidatorHostNullSuccessTest()
        {
            var mockDefinitionFake = new Faker <MockDefinition>()
                                     .RuleFor(m => m.Host, f => null);

            var input = new
            {
                mockDefinition = mockDefinitionFake.Generate()
            };

            var Target = new MockDefinitionValidator();

            Target.ShouldNotHaveValidationErrorFor(m => m.Host, input.mockDefinition.Host);
        }
コード例 #2
0
        public void MockDefinitionValidatorBasePathEmptySuccessTest()
        {
            var mockDefinitionFake = new Faker <MockDefinition>()
                                     .RuleFor(m => m.BasePath, f => string.Empty);

            var input = new
            {
                mockDefinition = mockDefinitionFake.Generate()
            };

            var Target = new MockDefinitionValidator();

            Target.ShouldNotHaveValidationErrorFor(m => m.BasePath, input.mockDefinition.BasePath);
        }
コード例 #3
0
        public void MockDefinitionValidatorSuccessTest(string host)
        {
            var mockDefinitionFake = new Faker <MockDefinition>()
                                     .RuleFor(m => m.Host, f => host);

            var input = new
            {
                mockDefinition = mockDefinitionFake.Generate(10)
            };

            var Target = new MockDefinitionValidator();

            foreach (var item in input.mockDefinition)
            {
                Target.ShouldNotHaveValidationErrorFor(m => m.Host, item.Host);
            }
        }