本文整理汇总了C#中CustomExtensions.UnitTests.Customization.Fixtures.BaseFixture类的典型用法代码示例。如果您正苦于以下问题:C# BaseFixture类的具体用法?C# BaseFixture怎么用?C# BaseFixture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BaseFixture类属于CustomExtensions.UnitTests.Customization.Fixtures命名空间,在下文中一共展示了BaseFixture类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Prepend_IsLazy
public void Prepend_IsLazy()
{
var fixture = new BaseFixture();
var breakingSequence = fixture.Create<BreakingSequence<object>>();
Assert.That(() => breakingSequence.Prepend(breakingSequence), Throws.Nothing);
}
示例2: ToEnumerable_OnObject_CreatesEnumerable
public void ToEnumerable_OnObject_CreatesEnumerable()
{
var fixture = new BaseFixture();
var objectValue = fixture.Create<object>();
Assert.That(() => objectValue.ToEnumerable(), Is.InstanceOf<IEnumerable<object>>());
}
示例3: NullableMin_OnNullSequence_WithSelector_ThrowsValidationException
public void NullableMin_OnNullSequence_WithSelector_ThrowsValidationException()
{
IEnumerable<GenericComparableStruct> nullSequence = null;
var fixture = new BaseFixture();
var selector = fixture.Create<Func<GenericComparableStruct, GenericComparableStruct>>();
Assert.That(() => nullSequence.NullableMin(selector), Throws.TypeOf<ValidationException>().With.InnerException.TypeOf<ArgumentNullException>());
}
示例4: ContainsExactly_OnEmptySequence_OnZero_MeetsPredicate_ReturnsTrue
public void ContainsExactly_OnEmptySequence_OnZero_MeetsPredicate_ReturnsTrue()
{
var fixture = new BaseFixture();
var emptySequence = Enumerable.Empty<object>();
var predicate = fixture.Create<Func<object, bool>>();
Assert.That(() => emptySequence.ContainsExactly(0, predicate), Is.True);
}
示例5: Append_OnEmptySequence_WithElement_ReturnsSequenceWithElement
public void Append_OnEmptySequence_WithElement_ReturnsSequenceWithElement()
{
var emptySequence = Enumerable.Empty<object>();
var fixture = new BaseFixture();
var objectValue = fixture.Create<object>();
Assert.That(() => emptySequence.Append(objectValue), Is.EqualTo(objectValue.ToEnumerable()));
}
示例6: ContainsOnlyOne_OnNullSequence_WithMeetsPredicate_ThrowsValidationException
public void ContainsOnlyOne_OnNullSequence_WithMeetsPredicate_ThrowsValidationException()
{
IEnumerable<object> nullSequence = null;
var fixture = new BaseFixture();
var predicate = fixture.Create<Func<object, bool>>();
Assert.That(() => nullSequence.ContainsOnlyOne(predicate), Throws.TypeOf<ValidationException>().With.InnerException.TypeOf<ArgumentNullException>());
}
示例7: Append_OnNullSequence_WithElelment_ThrowsValidationException
public void Append_OnNullSequence_WithElelment_ThrowsValidationException()
{
IEnumerable<object> nullSequence = null;
var fixture = new BaseFixture();
var objectValue = fixture.Create<object>();
Assert.That(() => nullSequence.Append(objectValue), Throws.TypeOf<ValidationException>().With.InnerException.TypeOf<ArgumentNullException>());
}
示例8: NullableMin_OnEmptySequence_WithSelector_ReturnsNull
public void NullableMin_OnEmptySequence_WithSelector_ReturnsNull()
{
var emptySequence = Enumerable.Empty<GenericComparableStruct>();
var fixture = new BaseFixture();
var selector = fixture.Create<Func<GenericComparableStruct, GenericComparableStruct>>();
Assert.That(() => emptySequence.NullableMin(selector), Is.Null);
}
示例9: Shuffle_OnEmptySequence_WithRandom_ReturnsEmptySequence
public void Shuffle_OnEmptySequence_WithRandom_ReturnsEmptySequence()
{
var emptySequence = Enumerable.Empty<object>();
var fixture = new BaseFixture();
var random = fixture.Create<Random>();
Assert.That(() => emptySequence.Shuffle(random), Is.Empty);
}
示例10: Shuffle_OnNullSequence_WithRandom_ThrowsValidationException
public void Shuffle_OnNullSequence_WithRandom_ThrowsValidationException()
{
IEnumerable<object> nullSequence = null;
var fixture = new BaseFixture();
var random = fixture.Create<Random>();
Assert.That(() => nullSequence.Shuffle(random), Throws.TypeOf<ValidationException>().With.InnerException.TypeOf<ArgumentNullException>());
}
示例11: Exclude_OnEmptySequence_WithPredicate_ReturnsEmptySequence
public void Exclude_OnEmptySequence_WithPredicate_ReturnsEmptySequence()
{
var emptySequence = Enumerable.Empty<object>();
var fixture = new BaseFixture();
var objectFunc = fixture.Create<Func<object, bool>>();
Assert.That(() => emptySequence.Exclude(objectFunc), Is.Empty);
}
示例12: RandomElement_OnEmptySequence_ThrowsValidationException
public void RandomElement_OnEmptySequence_ThrowsValidationException()
{
var fixture = new BaseFixture();
var random = fixture.Create<Random>();
var emptySequence = Enumerable.Empty<object>();
Assert.That(() => emptySequence.RandomElement(random), Throws.TypeOf<ValidationException>().With.InnerException.TypeOf<ArgumentException>());
}
示例13: Replace_OnEmptySequence_WithElement_WithReplacement_ReturnsEmptySequence
public void Replace_OnEmptySequence_WithElement_WithReplacement_ReturnsEmptySequence()
{
var emptySequence = Enumerable.Empty<object>();
var fixture = new BaseFixture();
var objectValue = fixture.Create<object>();
Assert.That(() => emptySequence.Replace(objectValue, objectValue), Is.Empty);
}
示例14: ContainsAny_OnCharacter_OnEmptyString_ReturnsFalse
public void ContainsAny_OnCharacter_OnEmptyString_ReturnsFalse()
{
var emptyString = string.Empty;
var fixture = new BaseFixture();
var charValue = fixture.Create<char>();
Assert.That(() => emptyString.ContainsAny(charValue), Is.False);
}
示例15: ContainsOnlyOne_OnEmptySequence_MeetsPredicate_ReturnsFalse
public void ContainsOnlyOne_OnEmptySequence_MeetsPredicate_ReturnsFalse()
{
var fixture = new BaseFixture();
var emptySequence = Enumerable.Empty<object>();
var predicate = fixture.Create<Func<object, bool>>();
Assert.That(() => emptySequence.ContainsOnlyOne(predicate), Is.False);
}