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


C# ExpressionObserver.Take方法代码示例

本文整理汇总了C#中ExpressionObserver.Take方法的典型用法代码示例。如果您正苦于以下问题:C# ExpressionObserver.Take方法的具体用法?C# ExpressionObserver.Take怎么用?C# ExpressionObserver.Take使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ExpressionObserver的用法示例。


在下文中一共展示了ExpressionObserver.Take方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Should_Get_UnsetValue_For_Object_Without_Indexer

        public async void Should_Get_UnsetValue_For_Object_Without_Indexer()
        {
            var data = new { Foo = 5 };
            var target = new ExpressionObserver(data, "Foo[noindexer]");
            var result = await target.Take(1);

            Assert.Equal(AvaloniaProperty.UnsetValue, result);
        }
开发者ID:jazzay,项目名称:Avalonia,代码行数:8,代码来源:ExpressionObserverTests_Indexer.cs

示例2: Should_Get_Simple_Property_Value

        public async void Should_Get_Simple_Property_Value()
        {
            var data = new Class1();
            var target = new ExpressionObserver(data, "Foo");
            var result = await target.Take(1);

            Assert.Equal("foo", result);
        }
开发者ID:JackWangCUMT,项目名称:Perspex,代码行数:8,代码来源:ExpressionObserverTests_PerspexProperty.cs

示例3: Array_Out_Of_Bounds_Should_Return_UnsetValue

        public async void Array_Out_Of_Bounds_Should_Return_UnsetValue()
        {
            var data = new { Foo = new[] { "foo", "bar" } };
            var target = new ExpressionObserver(data, "Foo[2]");
            var result = await target.Take(1);

            Assert.Equal(AvaloniaProperty.UnsetValue, result);
        }
开发者ID:jkoritzinsky,项目名称:Avalonia,代码行数:8,代码来源:ExpressionObserverTests_Indexer.cs

示例4: Should_Get_UnsetValue_For_Invalid_Dictionary_Index

        public async void Should_Get_UnsetValue_For_Invalid_Dictionary_Index()
        {
            var data = new { Foo = new Dictionary<int, string> { { 1, "foo" } } };
            var target = new ExpressionObserver(data, "Foo[invalid]");
            var result = await target.Take(1);

            Assert.Equal(AvaloniaProperty.UnsetValue, result);
        }
开发者ID:jazzay,项目名称:Avalonia,代码行数:8,代码来源:ExpressionObserverTests_Indexer.cs

示例5: Should_Get_Simple_Property_Value_Null

        public async void Should_Get_Simple_Property_Value_Null()
        {
            var data = new { Foo = (string)null };
            var target = new ExpressionObserver(data, "Foo");
            var result = await target.Take(1);

            Assert.Null(result);
        }
开发者ID:Arlorean,项目名称:Perspex,代码行数:8,代码来源:ExpressionObserverTests_Property.cs

示例6: Should_Negate_True_String

        public async void Should_Negate_True_String()
        {
            var data = new { Foo = "True" };
            var target = new ExpressionObserver(data, "!Foo");
            var result = await target.Take(1);

            Assert.Equal(false, result);
        }
开发者ID:JackWangCUMT,项目名称:Perspex,代码行数:8,代码来源:ExpressionObserverTests_Negation.cs

示例7: Should_Negate_Boolean_Value

        public async void Should_Negate_Boolean_Value()
        {
            var data = new { Foo = true };
            var target = new ExpressionObserver(data, "!Foo");
            var result = await target.Take(1);

            Assert.Equal(false, result);
        }
开发者ID:JackWangCUMT,项目名称:Perspex,代码行数:8,代码来源:ExpressionObserverTests_Negation.cs

示例8: Should_Negate_0

        public async void Should_Negate_0()
        {
            var data = new { Foo = 0 };
            var target = new ExpressionObserver(data, "!Foo");
            var result = await target.Take(1);

            Assert.Equal(true, result);
        }
开发者ID:JackWangCUMT,项目名称:Perspex,代码行数:8,代码来源:ExpressionObserverTests_Negation.cs

示例9: Should_Get_Value_For_String_Indexer

        public async void Should_Get_Value_For_String_Indexer()
        {
            var data = new { Foo = new Dictionary<string, string> { { "foo", "bar" }, { "baz", "qux" } } };
            var target = new ExpressionObserver(data, "Foo[foo]");
            var result = await target.Take(1);

            Assert.Equal("bar", result);
        }
开发者ID:jazzay,项目名称:Avalonia,代码行数:8,代码来源:ExpressionObserverTests_Indexer.cs

示例10: Should_Get_Value_For_Non_String_Indexer

        public async void Should_Get_Value_For_Non_String_Indexer()
        {
            var data = new { Foo = new Dictionary<double, string> { { 1.0, "bar" }, { 2.0, "qux" } } };
            var target = new ExpressionObserver(data, "Foo[1.0]");
            var result = await target.Take(1);

            Assert.Equal("bar", result);
        }
开发者ID:jazzay,项目名称:Avalonia,代码行数:8,代码来源:ExpressionObserverTests_Indexer.cs

示例11: Should_Get_Simple_Property_Chain

        public async void Should_Get_Simple_Property_Chain()
        {
            var data = new { Foo = new { Bar = new { Baz = "baz" } }  };
            var target = new ExpressionObserver(data, "Foo.Bar.Baz");
            var result = await target.Take(1);

            Assert.Equal("baz", result);
        }
开发者ID:Arlorean,项目名称:Perspex,代码行数:8,代码来源:ExpressionObserverTests_Property.cs

示例12: Array_With_Wrong_Dimensions_Should_Return_UnsetValue

        public async void Array_With_Wrong_Dimensions_Should_Return_UnsetValue()
        {
            var data = new { Foo = new[] { "foo", "bar" } };
            var target = new ExpressionObserver(data, "Foo[1,2]");
            var result = await target.Take(1);

            Assert.Equal(PerspexProperty.UnsetValue, result);
        }
开发者ID:Arlorean,项目名称:Perspex,代码行数:8,代码来源:ExpressionObserverTests_Indexer.cs

示例13: Should_Get_UnsetValue_For_Invalid_Array_Index

        public async void Should_Get_UnsetValue_For_Invalid_Array_Index()
        {
            var data = new { Foo = new[] { "foo", "bar" } };
            var target = new ExpressionObserver(data, "Foo[invalid]");
            var result = await target.Take(1);

            Assert.Equal(AvaloniaProperty.UnsetValue, result);
        }
开发者ID:jazzay,项目名称:Avalonia,代码行数:8,代码来源:ExpressionObserverTests_Indexer.cs

示例14: Should_Get_Simple_Property_From_Base_Class

        public async void Should_Get_Simple_Property_From_Base_Class()
        {
            var data = new Class3 { Foo = "foo" };
            var target = new ExpressionObserver(data, "Foo");
            var result = await target.Take(1);

            Assert.Equal("foo", result);
        }
开发者ID:Arlorean,项目名称:Perspex,代码行数:8,代码来源:ExpressionObserverTests_Property.cs

示例15: Should_Return_UnsetValue_For_Observable_Root_Null

        public async void Should_Return_UnsetValue_For_Observable_Root_Null()
        {
            var data = new Class3 { Foo = "foo" };
            var target = new ExpressionObserver(Observable.Return(default(object)), "Foo");
            var result = await target.Take(1);

            Assert.Equal(AvaloniaProperty.UnsetValue, result);
        }
开发者ID:jkoritzinsky,项目名称:Avalonia,代码行数:8,代码来源:ExpressionObserverTests_Property.cs


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