Exemple #1
0
 public void VerifyBoundariesForProperty()
 {
     var fixture = new Fixture();
     var assertion = new GuardClauseAssertion(fixture);
     var property = typeof(GuardedPropertyHolder<object>).GetProperty("Property");
     assertion.Verify(property);
 }
Exemple #2
0
 public void VerifyBoundariesForAllPropertiesOnMutableClass()
 {
     var fixture = new Fixture();
     var assertion = new GuardClauseAssertion(fixture);
     var properties = typeof(GuardedPropertyHolder<Version>).GetProperties();
     assertion.Verify(properties);
 }
Exemple #3
0
 public void VerifyBoundariesForMethod()
 {
     var fixture = new Fixture();
     var assertion = new GuardClauseAssertion(fixture);
     var method = typeof(GuardedMethodHost).GetMethod("ConsumeStringAndInt32AndGuid");
     assertion.Verify(method);
 }
Exemple #4
0
 public void VerifyBoundariesForAllMethods()
 {
     var fixture = new Fixture();
     var assertion = new GuardClauseAssertion(fixture);
     var methods = typeof(GuardedMethodHost).GetMethods();
     assertion.Verify(methods);
 }
Exemple #5
0
 public void VerifyBoundariesForAllPropertiesOnImmutableClass()
 {
     var fixture = new Fixture();
     var assertion = new GuardClauseAssertion(fixture);
     var properties = typeof(DoubleParameterType<string, object>).GetProperties();
     assertion.Verify(properties);
 }
 public void Methods_Should_Throw_When_Any_Args_Are_Null(GuardClauseAssertion assertion)
 {
     var methods =
         typeof (AdvProcessSettingsExtensions).GetMethods(BindingFlags.Static |
                                                          BindingFlags.Public).Where(m=>m.Name!="WithEnvironmentVariable");
     assertion.Verify(methods);
 }
Exemple #7
0
 public void VerifyBoundariesForAllMembers()
 {
     var fixture = new Fixture();
     var assertion = new GuardClauseAssertion(fixture);
     var members = typeof(GuardedConstructorHost<Version>).GetMembers();
     assertion.Verify(members);
 }
Exemple #8
0
 public void VerifyBoundariesForTypeWithRefMethod()
 {
     var fixture = new Fixture();
     var assertion = new GuardClauseAssertion(fixture);
     var type = typeof(TypeWithRefMethod<Version>);
     assertion.Verify(type);
 }
 public void NullForCtorArgumentsThrowsException(IFixture fixture, Name name)
 {
     fixture.Inject<IParameter>(new ParameterTest());
     fixture.Inject<ParameterMeta>(ParameterMeta.Create<IParameter>(name));
     var assertion = new GuardClauseAssertion(fixture);
     assertion.Verify(typeof(CmdApplicationConfiguration).GetConstructors());
 }
		public void Sut_ProcessCommand_VerifyGuardClauses(
			GuardClauseAssertion assertion,
			IAsyncCommand command)
		{
			var method = new Methods<ConcurrencyExecutionAsyncCommandBus>()
				.Select(sut => sut.ProcessCommand(command));				
            assertion.Verify(method);
		}
        public void ShouldGuardMethodParameters()
        {
            var fixture = new Fixture().Customize(new MediaDomainCustomization());

            var guardMethodParametersAssertion = new GuardClauseAssertion(fixture);

            guardMethodParametersAssertion.Verify(DomainTypes());
        }
        public void For_HasNullGuards(GuardClauseAssertion assertion, IFixture fixture)
        {
            // Arrange
            fixture.MakeNonRecursive();

            // Act
            // Assert
            assertion.Verify(typeof(DefaultGetNodeString).GetMethod("For"));
        }
            public void ShouldGuardCheckArguments(
                [Frozen]Fixture fixture,
                GuardClauseAssertion guardClauseAssertion)
            {
                fixture.Inject(typeof(EqualsSymmetricAssertion).GetMethod("Equals", BindingFlags.Public));

                guardClauseAssertion.Verify(typeof(EqualsSymmetricAssertion).GetMethod("Verify",
                    new[] { typeof(MethodInfo) }));
            }
        public void HasGuardedConstructor(Fixture fixture)
        {
            // -- Arrange

            // -- Act

            // -- Assert
            var assertion = new GuardClauseAssertion(fixture);
            assertion.Verify(typeof(CalculatorService).GetConstructors());
        }
        public void HasGuardedConstructor(Fixture fixture)
        {
            // -- Arrange

            // -- Act

            // -- Assert
            var assertion = new GuardClauseAssertion(fixture);
            assertion.Verify(typeof (CruncherAutomator).GetConstructors());
        }
        public void SutHasCorrectGuardClauses(
            GuardClauseAssertion assertion)
        {
            var members = new IdiomaticMembers(
                typeof(CompositeIdiomaticAssertion),
                MemberKinds.Constructor);

            foreach (var member in members)
                assertion.Verify(member);
        }
		public void AllMethodsShouldHaveProperGuardClauses(IFixture fixture)
		{
			// Arrange
			var assertion = new GuardClauseAssertion(fixture);

			// Act
			Type sutType = typeof (DayOfWeekInAMonthSpecification);

			// Assert
			assertion.Verify(sutType);
		}
Exemple #18
0
		public void AllMethodsShouldHaveProperGuardClauses(IFixture fixture)
		{
			// Arrange
			var assertion = new GuardClauseAssertion(fixture);

			// Act
			Type sutType = typeof(Event);

			// Assert
			assertion.Verify(sutType);
		}
 public void ShouldGuardCheckConstructorArguments(GuardClauseAssertion guardClauseAssertion)
 {
     guardClauseAssertion.Verify(typeof(RecordReplayConstructorSpecimensForTypeBuilder).GetConstructors());
 }
 public void ShouldGuardCheckConstructorArguments(GuardClauseAssertion guardClauseAssertion)
 {
     guardClauseAssertion.Verify(typeof(EqualsSymmetricAssertion).GetConstructors());
 }
 public void AllMethods_Null_GuardClause(GuardClauseAssertion assertion)
 {
     assertion.Verify(typeof(FilterStreamQueryBuilder));
 }
		public void Resolve_VerifyGuardClause(GuardClauseAssertion assertion, IAsyncQuery<string> query)
		{
			assertion.Verify<DefaultHttpRequestResolver>(d => d.ResolveHttpRequest(query));
		}
 public void C_TestGuardClause()
 {
     var assertion = new GuardClauseAssertion(Fixture);
     assertion.Verify(typeof(CommandLineParser).GetConstructors());
 }
 public void ArgumentsCannotBeNull(GuardClauseAssertion assertion)
 {
     // Exercise system and verify  outcome
     assertion.Verify(typeof (CompositeMessageInterceptor).GetConstructors());
 }
Exemple #25
0
 public void ConstructorHasAppropriateGuards(GuardClauseAssertion assertion)
 {
     assertion.Verify(typeof(RouteLinker).GetConstructors());
 }
 public void Constructor_Null_GuardClause(GuardClauseAssertion assertion)
 {
     assertion.Verify(typeof(Locations));
 }
 public void SutHasAppropriateGuards(GuardClauseAssertion assertion)
 {
     assertion.Verify(typeof(DefaultRouteDispatcher));
 }
 public void ShouldGuardCheckCreateMethodArguments(GuardClauseAssertion guardClauseAssertion)
 {
     guardClauseAssertion.Verify(typeof (RecordReplayConstructorSpecimensForTypeBuilder).GetMethod("Create"));
 }
 public void SutHasAppropriateGuards(GuardClauseAssertion assertion)
 {
     assertion.Verify(typeof(ScalarRouteValuesQuery));
 }
 public void GuardsDecoratee(GuardClauseAssertion guardClauseAssertion)
 {
     guardClauseAssertion.Verify(typeof(DynamicElementDecorator).GetConstructors());
 }