public void ReturnSelfCustomization(ExcludeAttribute sut, MethodInfo method)
        {
            // Act
            IArgNullExCustomization customization = sut.GetCustomization(method);

            // Assert
            Assert.Same(sut, customization);
        }
        public void ReturnSelfCustomization(ExcludeAttribute sut, MethodInfo method)
        {
            // Act
            IArgNullExCustomization customization = sut.GetCustomization(method);

            // Assert
            Assert.Same(sut, customization);
        }
        public void ThrowIfBothTypeAndTypeFullNameSpecified(
            ExcludeAttribute sut,
            MethodInfo method,
            Mock <IArgumentNullExceptionFixture> fixtureMock)
        {
            // AAA
            IArgNullExCustomization customization = sut.GetCustomization(method);

            Assert.Throws <InvalidOperationException>(() => customization.Customize(fixtureMock.Object));
        }
        private static void Execute(
            ExcludeAttribute sut,
            MethodInfo method,
            List<IFilter> filters,
            List<RegexRule> regexRules,
            Mock<IRegexFilter> regexFilterMock,
            Mock<IArgumentNullExceptionFixture> fixtureMock)
        {
            // Arrange
            regexFilterMock.SetupGet(r => r.Rules).Returns(regexRules);
            filters.Add(regexFilterMock.Object);
            fixtureMock.SetupGet(f => f.Filters).Returns(filters);
            List<RegexRule> existingRules = regexRules.ToList();

            // Act
            IArgNullExCustomization customization = sut.GetCustomization(method);
            customization.Customize(fixtureMock.Object);

            // Assert
            Assert.Equal(existingRules.Count + 1, regexRules.Count);
            Assert.False(existingRules.Except(regexRules).Any());
        }
        public void ThrowIfNothingSpecified(
            ExcludeAttribute sut,
            MethodInfo method,
            List <IFilter> filters,
            List <RegexRule> regexRules,
            Mock <IRegexFilter> regexFilterMock,
            Mock <IArgumentNullExceptionFixture> fixtureMock)
        {
            // Arrange
            regexFilterMock.SetupGet(r => r.Rules).Returns(regexRules);
            filters.Add(regexFilterMock.Object);
            fixtureMock.SetupGet(f => f.Filters).Returns(filters);

            // Act
            sut.Parameter    = null;
            sut.Method       = null;
            sut.Type         = null;
            sut.TypeFullName = null;
            IArgNullExCustomization customization = sut.GetCustomization(method);

            Assert.Throws <InvalidOperationException>(() => customization.Customize(fixtureMock.Object));
        }
        private static void Execute(
            ExcludeAttribute sut,
            MethodInfo method,
            List <IFilter> filters,
            List <RegexRule> regexRules,
            Mock <IRegexFilter> regexFilterMock,
            Mock <IArgumentNullExceptionFixture> fixtureMock)
        {
            // Arrange
            regexFilterMock.SetupGet(r => r.Rules).Returns(regexRules);
            filters.Add(regexFilterMock.Object);
            fixtureMock.SetupGet(f => f.Filters).Returns(filters);
            List <RegexRule> existingRules = regexRules.ToList();

            // Act
            IArgNullExCustomization customization = sut.GetCustomization(method);

            customization.Customize(fixtureMock.Object);

            // Assert
            Assert.Equal(existingRules.Count + 1, regexRules.Count);
            Assert.False(existingRules.Except(regexRules).Any());
        }
        public void ThrowIfNothingSpecified(
            ExcludeAttribute sut,
            MethodInfo method,
            List<IFilter> filters,
            List<RegexRule> regexRules,
            Mock<IRegexFilter> regexFilterMock,
            Mock<IArgumentNullExceptionFixture> fixtureMock)
        {
            // Arrange
            regexFilterMock.SetupGet(r => r.Rules).Returns(regexRules);
            filters.Add(regexFilterMock.Object);
            fixtureMock.SetupGet(f => f.Filters).Returns(filters);

            // Act
            sut.Parameter = null;
            sut.Method = null;
            sut.Type = null;
            sut.TypeFullName = null;
            IArgNullExCustomization customization = sut.GetCustomization(method);
            Assert.Throws<InvalidOperationException>(() => customization.Customize(fixtureMock.Object));
        }
 public void ThrowIfBothTypeAndTypeFullNameSpecified(
     ExcludeAttribute sut,
     MethodInfo method,
     Mock<IArgumentNullExceptionFixture> fixtureMock)
 {
     // AAA
     IArgNullExCustomization customization = sut.GetCustomization(method);
     Assert.Throws<InvalidOperationException>(() => customization.Customize(fixtureMock.Object));
 }