当前位置: 首页>>代码示例>>C#>>正文


C# BaseFixture.Create方法代码示例

本文整理汇总了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);
            }
开发者ID:jcomtois,项目名称:CustomExtensions,代码行数:8,代码来源:AppendTest.cs

示例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);
            }
开发者ID:jcomtois,项目名称:CustomExtensions,代码行数:9,代码来源:DistinctByTest.cs

示例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);
            }
开发者ID:jcomtois,项目名称:CustomExtensions,代码行数:9,代码来源:ReplaceTest.cs

示例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>>());
            }
开发者ID:jcomtois,项目名称:CustomExtensions,代码行数:7,代码来源:ToEnumerableTest.cs

示例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>());
            }
开发者ID:jcomtois,项目名称:CustomExtensions,代码行数:8,代码来源:NullableMinTest.cs

示例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);
            }
开发者ID:jcomtois,项目名称:CustomExtensions,代码行数:8,代码来源:ContainsExactlyTest.cs

示例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>());
            }
开发者ID:jcomtois,项目名称:CustomExtensions,代码行数:8,代码来源:ShuffleTest.cs

示例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>());
        }
开发者ID:jcomtois,项目名称:CustomExtensions,代码行数:8,代码来源:ContainsOnlyOneTest.cs

示例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);
        }
开发者ID:jcomtois,项目名称:CustomExtensions,代码行数:8,代码来源:ContainsOnlyOneTest.cs

示例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>());
            }
开发者ID:jcomtois,项目名称:CustomExtensions,代码行数:8,代码来源:ContainsAnyTest.cs

示例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>());
            }
开发者ID:jcomtois,项目名称:CustomExtensions,代码行数:8,代码来源:AppendTest.cs

示例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()));
            }
开发者ID:jcomtois,项目名称:CustomExtensions,代码行数:8,代码来源:AppendTest.cs

示例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);
            }
开发者ID:jcomtois,项目名称:CustomExtensions,代码行数:8,代码来源:NullableMinTest.cs

示例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);
            }
开发者ID:jcomtois,项目名称:CustomExtensions,代码行数:8,代码来源:ShuffleTest.cs

示例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);
            }
开发者ID:jcomtois,项目名称:CustomExtensions,代码行数:8,代码来源:ContainsAnyTest.cs


注:本文中的CustomExtensions.UnitTests.Customization.Fixtures.BaseFixture.Create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。