本文整理汇总了C#中CustomExtensions.UnitTests.Customization.Fixtures.BaseFixture.Create方法的典型用法代码示例。如果您正苦于以下问题:C# BaseFixture.Create方法的具体用法?C# BaseFixture.Create怎么用?C# BaseFixture.Create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CustomExtensions.UnitTests.Customization.Fixtures.BaseFixture
的用法示例。
在下文中一共展示了BaseFixture.Create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Append_IsLazy
public void Append_IsLazy()
{
var fixture = new BaseFixture();
var breakingSequence = fixture.Create<BreakingSequence<object>>();
var objectValue = fixture.Create<object>();
Assert.That(() => breakingSequence.Append(objectValue), Throws.Nothing);
}
示例2: DistinctBy_IsLazy
public void DistinctBy_IsLazy()
{
var fixture = new BaseFixture();
var breakingSequence = fixture.Create<BreakingSequence<object>>();
var objectFunc = fixture.Create<Func<object, object>>();
Assert.That(() => breakingSequence.DistinctBy(objectFunc), Throws.Nothing);
}
示例3: Replace_OnEmptySequence_WithElement_WithProjection_ReturnsEmptySequence
public void Replace_OnEmptySequence_WithElement_WithProjection_ReturnsEmptySequence()
{
var emptySequence = Enumerable.Empty<object>();
var fixture = new BaseFixture();
var objectValue = fixture.Create<object>();
var objectFunc = fixture.Create<Func<object, object>>();
Assert.That(() => emptySequence.Replace(objectValue, objectFunc), Is.Empty);
}
示例4: 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>>());
}
示例5: 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>());
}
示例6: 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);
}
示例7: 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>());
}
示例8: 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>());
}
示例9: 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);
}
示例10: ContainsAny_OnCharacter_OnNullString_ThrowsValidationException
public void ContainsAny_OnCharacter_OnNullString_ThrowsValidationException()
{
string nullString = null;
var fixture = new BaseFixture();
var charValue = fixture.Create<char>();
Assert.That(() => nullString.ContainsAny(charValue), Throws.TypeOf<ValidationException>().With.InnerException.TypeOf<ArgumentNullException>());
}
示例11: 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>());
}
示例12: 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()));
}
示例13: 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);
}
示例14: 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);
}
示例15: 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);
}