• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Fixtures.BaseFixture类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CustomExtensions.UnitTests.Customization.Fixtures.BaseFixture的典型用法代码示例。如果您正苦于以下问题:C# BaseFixture类的具体用法?C# BaseFixture怎么用?C# BaseFixture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BaseFixture类属于CustomExtensions.UnitTests.Customization.Fixtures命名空间,在下文中一共展示了BaseFixture类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
            }
开发者ID:jcomtois,项目名称:CustomExtensions,代码行数:7,代码来源:PrependTest.cs


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


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


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


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


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


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


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


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


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


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


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


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


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


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


示例16: 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


示例17: 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


示例18: ToString_OnEmptySequence_WithProjection_WithNullSeparator_ReturnsEmptyString

            public void ToString_OnEmptySequence_WithProjection_WithNullSeparator_ReturnsEmptyString()
            {
                var emptySequence = Enumerable.Empty<object>();
                var fixture = new BaseFixture();
                var projection = fixture.Create<Func<object, string>>();
                string nullSeparator = null;

                Assert.That(() => emptySequence.ToString(projection, nullSeparator), Is.Empty);
            }
开发者ID:jcomtois,项目名称:CustomExtensions,代码行数:9,代码来源:ToStringTest.cs


示例19: Replace_OnEmptySequence_WithElement_WithNullProjection_ThrowsValidationException

            public void Replace_OnEmptySequence_WithElement_WithNullProjection_ThrowsValidationException()
            {
                var emptySequence = Enumerable.Empty<object>();
                var fixture = new BaseFixture();
                var objectValue = fixture.Create<object>();
                Func<object, object> nullFunc = null;

                Assert.That(() => emptySequence.Replace(objectValue, nullFunc), Throws.TypeOf<ValidationException>().With.InnerException.TypeOf<ArgumentNullException>());
            }
开发者ID:jcomtois,项目名称:CustomExtensions,代码行数:9,代码来源:ReplaceTest.cs


示例20: Truncate_OnString_LengthIsGreaterThanElpises_ReturnsString

            public void Truncate_OnString_LengthIsGreaterThanElpises_ReturnsString()
            {
                var fixture = new BaseFixture();
                var charValue = fixture.Create<char>();
                var maxLength = ValidLength - 1;
                var shortString = new string(charValue, maxLength);

                Assert.That(() => shortString.Truncate(ValidLength + 1), Is.EqualTo(shortString));
            }
开发者ID:jcomtois,项目名称:CustomExtensions,代码行数:9,代码来源:TruncateTest.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Fixtures.RandomNumberFixture类代码示例发布时间:2022-05-24
下一篇:
C# SPARSE.cusparseMatDescr类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap