Ejemplo n.º 1
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 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());
 }
Ejemplo n.º 3
0
 public void VerifyBoundariesForTypeWithRefMethod()
 {
     var fixture = new Fixture();
     var assertion = new GuardClauseAssertion(fixture);
     var type = typeof(TypeWithRefMethod<Version>);
     assertion.Verify(type);
 }
 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);
 }
Ejemplo n.º 5
0
 public void VerifyBoundariesForMethod()
 {
     var fixture = new Fixture();
     var assertion = new GuardClauseAssertion(fixture);
     var method = typeof(GuardedMethodHost).GetMethod("ConsumeStringAndInt32AndGuid");
     assertion.Verify(method);
 }
Ejemplo n.º 6
0
 public void VerifyBoundariesForProperty()
 {
     var fixture = new Fixture();
     var assertion = new GuardClauseAssertion(fixture);
     var property = typeof(GuardedPropertyHolder<object>).GetProperty("Property");
     assertion.Verify(property);
 }
Ejemplo n.º 7
0
 public void VerifyBoundariesForAllMembers()
 {
     var fixture = new Fixture();
     var assertion = new GuardClauseAssertion(fixture);
     var members = typeof(GuardedConstructorHost<Version>).GetMembers();
     assertion.Verify(members);
 }
Ejemplo n.º 8
0
 public void VerifyBoundariesForAllPropertiesOnMutableClass()
 {
     var fixture = new Fixture();
     var assertion = new GuardClauseAssertion(fixture);
     var properties = typeof(GuardedPropertyHolder<Version>).GetProperties();
     assertion.Verify(properties);
 }
Ejemplo n.º 9
0
 public void VerifyBoundariesForAllMethods()
 {
     var fixture = new Fixture();
     var assertion = new GuardClauseAssertion(fixture);
     var methods = typeof(GuardedMethodHost).GetMethods();
     assertion.Verify(methods);
 }
		public void Sut_ProcessCommand_VerifyGuardClauses(
			GuardClauseAssertion assertion,
			IAsyncCommand command)
		{
			var method = new Methods<ConcurrencyExecutionAsyncCommandBus>()
				.Select(sut => sut.ProcessCommand(command));				
            assertion.Verify(method);
		}
Ejemplo n.º 11
0
        public void ShouldGuardMethodParameters()
        {
            var fixture = new Fixture().Customize(new MediaDomainCustomization());

            var guardMethodParametersAssertion = new GuardClauseAssertion(fixture);

            guardMethodParametersAssertion.Verify(DomainTypes());
        }
            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 For_HasNullGuards(GuardClauseAssertion assertion, IFixture fixture)
        {
            // Arrange
            fixture.MakeNonRecursive();

            // Act
            // Assert
            assertion.Verify(typeof(DefaultGetNodeString).GetMethod("For"));
        }
        public void SutHasCorrectGuardClauses(
            GuardClauseAssertion assertion)
        {
            var members = new IdiomaticMembers(
                typeof(CompositeIdiomaticAssertion),
                MemberKinds.Constructor);

            foreach (var member in members)
                assertion.Verify(member);
        }
Ejemplo n.º 15
0
        public void HasGuardedConstructor(Fixture fixture)
        {
            // -- Arrange

            // -- Act

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

            // -- Act

            // -- Assert
            var assertion = new GuardClauseAssertion(fixture);
            assertion.Verify(typeof (CruncherAutomator).GetConstructors());
        }
Ejemplo n.º 17
0
		public void Sut_GuardClauses(
		  GuardClauseAssertion	assertion)
		{
			//arrange

			//act
			assertion.VerifyConstructors<ObserveCanExecuteStrategy<object>>();

			//assert
		}
		public void AllMethodsShouldHaveProperGuardClauses(IFixture fixture)
		{
			// Arrange
			var assertion = new GuardClauseAssertion(fixture);

			// Act
			Type sutType = typeof (DayOfWeekInAMonthSpecification);

			// Assert
			assertion.Verify(sutType);
		}
Ejemplo n.º 19
0
		public void AllMethodsShouldHaveProperGuardClauses(IFixture fixture)
		{
			// Arrange
			var assertion = new GuardClauseAssertion(fixture);

			// Act
			Type sutType = typeof(Event);

			// Assert
			assertion.Verify(sutType);
		}
Ejemplo n.º 20
0
		public void Sut_VerifyGuardClauses(Fixture fixture)
		{
			var assertion = new GuardClauseAssertion(
				fixture,
				new SkipSpecifiedParametersBehaviorExpectation(
				new CompositeBehaviorExpectation(
					new EmptyGuidBehaviorExpectation(),
					new NullReferenceBehaviorExpectation()),
				"value")
				);
			assertion.VerifyConstructors<CacheEntry<string>>();
		}
 public void Sut_VerifyGuardClauses(GuardClauseAssertion assertion)
 {
     assertion.VerifyType<SynchronizationController>();
 }
 public void SutHasAppropriateGuards(GuardClauseAssertion assertion)
 {
     assertion.Verify(typeof(ScalarRouteValuesQuery));
 }
Ejemplo n.º 23
0
 public void ConstructorHasAppropriateGuards(GuardClauseAssertion assertion)
 {
     assertion.Verify(typeof(RouteLinker).GetConstructors());
 }
Ejemplo n.º 24
0
		public void Sut_VerifyConstructorGuardClauses(GuardClauseAssertion assertion)
		{
			assertion.VerifyConstructors<NotifyCommandStateBus>();
		}
Ejemplo n.º 25
0
 public void SutHasAppropriateGuards(GuardClauseAssertion assertion)
 {
     assertion.Verify(typeof(DefaultRouteDispatcher));
 }
 public void Constructor_Null_GuardClause(GuardClauseAssertion assertion)
 {
     assertion.Verify(typeof(Locations));
 }
 public void ShouldGuardCheckConstructorArguments(GuardClauseAssertion guardClauseAssertion)
 {
     guardClauseAssertion.Verify(typeof(EqualsSymmetricAssertion).GetConstructors());
 }
Ejemplo n.º 28
0
		public void Sut_TestGuardClauses(
			GuardClauseAssertion assertion)
		{
			assertion.VerifyConstructors<CacheService>();
		}
Ejemplo n.º 29
0
		public void Sut_VerifyGuardClauses(
			GuardClauseAssertion assertion)
		{
			assertion.VerifyType<FileSynchronizer>();
		}
 public void AllMethods_Null_GuardClause(GuardClauseAssertion assertion)
 {
     assertion.Verify(typeof(FilterStreamQueryBuilder));
 }