本文整理汇总了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);
}
示例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());
}
示例3: VerifyBoundariesForTypeWithRefMethod
public void VerifyBoundariesForTypeWithRefMethod()
{
var fixture = new Fixture();
var assertion = new GuardClauseAssertion(fixture);
var type = typeof(TypeWithRefMethod<Version>);
assertion.Verify(type);
}
示例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);
}
示例5: VerifyBoundariesForMethod
public void VerifyBoundariesForMethod()
{
var fixture = new Fixture();
var assertion = new GuardClauseAssertion(fixture);
var method = typeof(GuardedMethodHost).GetMethod("ConsumeStringAndInt32AndGuid");
assertion.Verify(method);
}
示例6: VerifyBoundariesForProperty
public void VerifyBoundariesForProperty()
{
var fixture = new Fixture();
var assertion = new GuardClauseAssertion(fixture);
var property = typeof(GuardedPropertyHolder<object>).GetProperty("Property");
assertion.Verify(property);
}
示例7: VerifyBoundariesForAllMembers
public void VerifyBoundariesForAllMembers()
{
var fixture = new Fixture();
var assertion = new GuardClauseAssertion(fixture);
var members = typeof(GuardedConstructorHost<Version>).GetMembers();
assertion.Verify(members);
}
示例8: VerifyBoundariesForAllPropertiesOnMutableClass
public void VerifyBoundariesForAllPropertiesOnMutableClass()
{
var fixture = new Fixture();
var assertion = new GuardClauseAssertion(fixture);
var properties = typeof(GuardedPropertyHolder<Version>).GetProperties();
assertion.Verify(properties);
}
示例9: VerifyBoundariesForAllMethods
public void VerifyBoundariesForAllMethods()
{
var fixture = new Fixture();
var assertion = new GuardClauseAssertion(fixture);
var methods = typeof(GuardedMethodHost).GetMethods();
assertion.Verify(methods);
}
示例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);
}
示例11: ShouldGuardMethodParameters
public void ShouldGuardMethodParameters()
{
var fixture = new Fixture().Customize(new MediaDomainCustomization());
var guardMethodParametersAssertion = new GuardClauseAssertion(fixture);
guardMethodParametersAssertion.Verify(DomainTypes());
}
示例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) }));
}
示例13: For_HasNullGuards
public void For_HasNullGuards(GuardClauseAssertion assertion, IFixture fixture)
{
// Arrange
fixture.MakeNonRecursive();
// Act
// Assert
assertion.Verify(typeof(DefaultGetNodeString).GetMethod("For"));
}
示例14: SutHasCorrectGuardClauses
public void SutHasCorrectGuardClauses(
GuardClauseAssertion assertion)
{
var members = new IdiomaticMembers(
typeof(CompositeIdiomaticAssertion),
MemberKinds.Constructor);
foreach (var member in members)
assertion.Verify(member);
}
示例15: HasGuardedConstructor
public void HasGuardedConstructor(Fixture fixture)
{
// -- Arrange
// -- Act
// -- Assert
var assertion = new GuardClauseAssertion(fixture);
assertion.Verify(typeof(CalculatorService).GetConstructors());
}