當前位置: 首頁>>代碼示例>>C#>>正文


C# Methods.Select方法代碼示例

本文整理匯總了C#中System.Methods.Select方法的典型用法代碼示例。如果您正苦於以下問題:C# Methods.Select方法的具體用法?C# Methods.Select怎麽用?C# Methods.Select使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Methods的用法示例。


在下文中一共展示了Methods.Select方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SelectNonMethodCallExpressionWithoutReturnThrows

 public void SelectNonMethodCallExpressionWithoutReturnThrows()
 {
     var sut = new Methods<ClassWithMethods>();
     Expression<Action<ClassWithMethods>> nonMethodCallExpression =
         _ => new object();
     Assert.Throws<ArgumentException>(
         () => sut.Select(nonMethodCallExpression));
 }
開發者ID:kumaraswamy86d12,項目名稱:Albedo,代碼行數:8,代碼來源:MethodsTests.cs

示例2: SelectParameterLessReturnsCorrectMethod

        public void SelectParameterLessReturnsCorrectMethod()
        {
            var sut = new Methods<ClassWithMethods>();

            MethodInfo actual = sut.Select(x => x.OmitParameters());

            var expected = typeof(ClassWithMethods).GetMethod("OmitParameters");
            Assert.Equal(expected, actual);
        }
開發者ID:kumaraswamy86d12,項目名稱:Albedo,代碼行數:9,代碼來源:MethodsTests.cs

示例3: GuardClauses

        public void GuardClauses()
        {
            IFixture fixture = new Fixture().Customize(new AutoRhinoMockCustomization());
            fixture.Customize<Control>(c => c.OmitAutoProperties());
            fixture.Customizations.Add(new PointBuilder());
            var methods = new Methods<ValuesToolTip>();
            var members = new List<MemberInfo>(typeof(ValuesToolTip).GetMembers());
            members.Remove(methods.Select(tt => tt.Set(default(string))));
            members.Remove(methods.Select(tt => tt.Set(default(string), default(Point))));

            fixture.Create<GuardClauseAssertion>()
                .Verify(members);
        }
開發者ID:BornThisWay,項目名稱:ZedGraph,代碼行數:13,代碼來源:ValuesToolTipTests.cs

示例4: SelectNullThrows

 public void SelectNullThrows()
 {
     var sut = new Methods<ClassWithMethods>();
     Assert.Throws<ArgumentNullException>(() => sut.Select(null));
 }
開發者ID:kumaraswamy86d12,項目名稱:Albedo,代碼行數:5,代碼來源:MethodsTests.cs

示例5: SelectNullFuncThrows

 public void SelectNullFuncThrows()
 {
     var sut = new Methods<ClassWithMethods>();
     Assert.Throws<ArgumentNullException>(() =>
         sut.Select((Expression<Func<ClassWithMethods, object>>)null));
 }
開發者ID:kumaraswamy86d12,項目名稱:Albedo,代碼行數:6,代碼來源:MethodsTests.cs

示例6: SelectNonMethodCallExpressionThrows

 public void SelectNonMethodCallExpressionThrows()
 {
     var sut = new Methods<ClassWithMethods>();
     Assert.Throws<ArgumentException>(
         () => sut.Select(_ => 1 + 1));
 }
開發者ID:kumaraswamy86d12,項目名稱:Albedo,代碼行數:6,代碼來源:MethodsTests.cs


注:本文中的System.Methods.Select方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。