當前位置: 首頁>>代碼示例>>C#>>正文


C# Idioms.GuardClauseAssertion類代碼示例

本文整理匯總了C#中Ploeh.AutoFixture.Idioms.GuardClauseAssertion的典型用法代碼示例。如果您正苦於以下問題:C# GuardClauseAssertion類的具體用法?C# GuardClauseAssertion怎麽用?C# GuardClauseAssertion使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GuardClauseAssertion類屬於Ploeh.AutoFixture.Idioms命名空間,在下文中一共展示了GuardClauseAssertion類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: VerifyBoundariesForAllPropertiesOnImmutableClass

 public void VerifyBoundariesForAllPropertiesOnImmutableClass()
 {
     var fixture = new Fixture();
     var assertion = new GuardClauseAssertion(fixture);
     var properties = typeof(DoubleParameterType<string, object>).GetProperties();
     assertion.Verify(properties);
 }
開發者ID:dhilgarth,項目名稱:AutoFixture,代碼行數:7,代碼來源:Scenario.cs

示例2: NullForCtorArgumentsThrowsException

 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());
 }
開發者ID:rahulpnath,項目名稱:clal,代碼行數:7,代碼來源:CmdApplicationConfigurationTest.cs

示例3: VerifyBoundariesForTypeWithRefMethod

 public void VerifyBoundariesForTypeWithRefMethod()
 {
     var fixture = new Fixture();
     var assertion = new GuardClauseAssertion(fixture);
     var type = typeof(TypeWithRefMethod<Version>);
     assertion.Verify(type);
 }
開發者ID:dhilgarth,項目名稱:AutoFixture,代碼行數:7,代碼來源:Scenario.cs

示例4: Methods_Should_Throw_When_Any_Args_Are_Null

 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);
 }
開發者ID:jrnail23,項目名稱:Cake.Process,代碼行數:7,代碼來源:AdvProcessSettingsTests.cs

示例5: VerifyBoundariesForMethod

 public void VerifyBoundariesForMethod()
 {
     var fixture = new Fixture();
     var assertion = new GuardClauseAssertion(fixture);
     var method = typeof(GuardedMethodHost).GetMethod("ConsumeStringAndInt32AndGuid");
     assertion.Verify(method);
 }
開發者ID:dhilgarth,項目名稱:AutoFixture,代碼行數:7,代碼來源:Scenario.cs

示例6: VerifyBoundariesForProperty

 public void VerifyBoundariesForProperty()
 {
     var fixture = new Fixture();
     var assertion = new GuardClauseAssertion(fixture);
     var property = typeof(GuardedPropertyHolder<object>).GetProperty("Property");
     assertion.Verify(property);
 }
開發者ID:dhilgarth,項目名稱:AutoFixture,代碼行數:7,代碼來源:Scenario.cs

示例7: VerifyBoundariesForAllMembers

 public void VerifyBoundariesForAllMembers()
 {
     var fixture = new Fixture();
     var assertion = new GuardClauseAssertion(fixture);
     var members = typeof(GuardedConstructorHost<Version>).GetMembers();
     assertion.Verify(members);
 }
開發者ID:dhilgarth,項目名稱:AutoFixture,代碼行數:7,代碼來源:Scenario.cs

示例8: VerifyBoundariesForAllPropertiesOnMutableClass

 public void VerifyBoundariesForAllPropertiesOnMutableClass()
 {
     var fixture = new Fixture();
     var assertion = new GuardClauseAssertion(fixture);
     var properties = typeof(GuardedPropertyHolder<Version>).GetProperties();
     assertion.Verify(properties);
 }
開發者ID:dhilgarth,項目名稱:AutoFixture,代碼行數:7,代碼來源:Scenario.cs

示例9: VerifyBoundariesForAllMethods

 public void VerifyBoundariesForAllMethods()
 {
     var fixture = new Fixture();
     var assertion = new GuardClauseAssertion(fixture);
     var methods = typeof(GuardedMethodHost).GetMethods();
     assertion.Verify(methods);
 }
開發者ID:dhilgarth,項目名稱:AutoFixture,代碼行數:7,代碼來源:Scenario.cs

示例10: Sut_ProcessCommand_VerifyGuardClauses

		public void Sut_ProcessCommand_VerifyGuardClauses(
			GuardClauseAssertion assertion,
			IAsyncCommand command)
		{
			var method = new Methods<ConcurrencyExecutionAsyncCommandBus>()
				.Select(sut => sut.ProcessCommand(command));				
            assertion.Verify(method);
		}
開發者ID:Galad,項目名稱:Hanno,代碼行數:8,代碼來源:ConcurrencyExecutionAsyncCommandBusTests.cs

示例11: ShouldGuardMethodParameters

        public void ShouldGuardMethodParameters()
        {
            var fixture = new Fixture().Customize(new MediaDomainCustomization());

            var guardMethodParametersAssertion = new GuardClauseAssertion(fixture);

            guardMethodParametersAssertion.Verify(DomainTypes());
        }
開發者ID:Martin-Bohring,項目名稱:fixieSpec,代碼行數:8,代碼來源:AllDomainTypesTests.cs

示例12: ShouldGuardCheckArguments

            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) }));
            }
開發者ID:baks,項目名稱:EqualityTests,代碼行數:9,代碼來源:EqualsSymmetricAssertionTests.cs

示例13: For_HasNullGuards

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

            // Act
            // Assert
            assertion.Verify(typeof(DefaultGetNodeString).GetMethod("For"));
        }
開發者ID:TeaDrivenDev,項目名稱:Graphology,代碼行數:9,代碼來源:DefaultGetNodeStringTests.cs

示例14: SutHasCorrectGuardClauses

        public void SutHasCorrectGuardClauses(
            GuardClauseAssertion assertion)
        {
            var members = new IdiomaticMembers(
                typeof(CompositeIdiomaticAssertion),
                MemberKinds.Constructor);

            foreach (var member in members)
                assertion.Verify(member);
        }
開發者ID:jwChung,項目名稱:Experimentalism,代碼行數:10,代碼來源:CompositeIdiomaticAssertionTest.cs

示例15: HasGuardedConstructor

        public void HasGuardedConstructor(Fixture fixture)
        {
            // -- Arrange

            // -- Act

            // -- Assert
            var assertion = new GuardClauseAssertion(fixture);
            assertion.Verify(typeof(CalculatorService).GetConstructors());
        }
開發者ID:nohwnd,項目名稱:Calculator,代碼行數:10,代碼來源:CalculatorServiceTests.cs


注:本文中的Ploeh.AutoFixture.Idioms.GuardClauseAssertion類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。