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


C# Verify.IsNotNull方法代码示例

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


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

示例1: MetadataCache_Test31

 public void MetadataCache_Test31()
 {
     using (var verify = new Verify())
     {
         var result = MetadataCache.GetMetadata(typeof(ShadowedMock));
         verify.IsNotNull(result, "cache should never return null");
     }
 }
开发者ID:docevaad,项目名称:Anchor,代码行数:8,代码来源:MetadataCacheTests.cs

示例2: MetadataCache_Test26

 public void MetadataCache_Test26()
 {
     using (var verify = new Verify())
     {
         var result = MetadataCache.GetMetadata(typeof(Mock));
         PropertyMetadata p;
         verify.IsTrue(result.Properties.TryGetValue("PublicProperty", out p), "TryGet should have succeeded");
         verify.IsNotNull(p, "TryGet should have succeeded");
     }
 }
开发者ID:docevaad,项目名称:Anchor,代码行数:10,代码来源:MetadataCacheTests.cs

示例3: MetadataCache_Test29

 public void MetadataCache_Test29()
 {
     using (var verify = new Verify())
     {
         var result = (IEnumerable)MetadataCache.GetMetadata(typeof(Mock)).Properties;
         verify.IsNotNull(result.GetEnumerator(), "basic enumerator check");
     }
 }
开发者ID:docevaad,项目名称:Anchor,代码行数:8,代码来源:MetadataCacheTests.cs

示例4: MetadataCache_Test14B

        public void MetadataCache_Test14B()
        {
            using (var verify = new Verify())
            {
                var result = MetadataCache.GetMetadata(typeof(StringIndexedMock));
                var x = result.Properties["Item [System.String]"];
                verify.IsNotNull(x, "Item [System.String] property is missing");

                var y = result.Properties["Item[]"];
                verify.IsNotNull(y, "Item[] property is missing");
                verify.AreSame(x, y, "Item[] and Item [System.String] don't match");
            }
        }
开发者ID:docevaad,项目名称:Anchor,代码行数:13,代码来源:MetadataCacheTests.cs

示例5: MetadataCache_Test14

        public void MetadataCache_Test14()
        {
            using (var verify = new Verify())
            {
                var result = MetadataCache.GetMetadata(typeof(List<int>));

                foreach (var item in result.Properties)
                {
                    Debug.WriteLine(item.Name);
                }

                var x = result.Properties["Item [Int32]"];
                verify.IsNotNull(x, "Item [Int32] property is missing");

                var y = result.Properties["Item[]"];
                verify.IsNotNull(y, "Item[] property is missing");
                verify.AreSame(x, y, "Item[] and Item [Int32] don't match");
            }
        }
开发者ID:docevaad,项目名称:Anchor,代码行数:19,代码来源:MetadataCacheTests.cs

示例6: MetadataCache_SetOnlyProperty_Test

        public void MetadataCache_SetOnlyProperty_Test()
        {
            using (var verify = new Verify())
            {
                var result = MetadataCache.GetMetadata(typeof(Mock));
                verify.IsNotNull(result, "GetMetadata returned a null");

                var setOnlyProperty = result.Properties["SetOnlyProperty"];
                verify.IsNotNull(setOnlyProperty, "property wasn't found");
                verify.IsFalse(setOnlyProperty.AffectsCalculatedFields, "not used in calculated fields");
                verify.AreEqual(0, setOnlyProperty.CalculatedFields.Length, "not used in calculated fields");
                verify.IsFalse(setOnlyProperty.CanRead, "CanRead");
                verify.IsTrue(setOnlyProperty.CanWrite, "CanWrite");
                verify.AreEqual("SetOnlyProperty", setOnlyProperty.Name, "Name");
                verify.AreEqual("SetOnlyProperty", setOnlyProperty.PropertyChangedEventArgs.PropertyName, "PropertyName");
                verify.AreEqual(typeof(int), setOnlyProperty.PropertyType, "PropertyType");

                verify.AreEqual(0, setOnlyProperty.Validators.Length, "not used in validation");
            }
        }
开发者ID:docevaad,项目名称:Anchor,代码行数:20,代码来源:MetadataCacheTests.cs

示例7: MetadataCache_PublicProperty_Test

        public void MetadataCache_PublicProperty_Test()
        {
            using (var verify = new Verify())
            {
                var result = MetadataCache.GetMetadata(typeof(Mock));
                verify.IsNotNull(result, "GetMetadata returned a null");

                var publicProperty = result.Properties["PublicProperty"];
                verify.IsNotNull(publicProperty, "property wasn't found");
                verify.IsFalse(publicProperty.AffectsCalculatedFields, "not used in calculated fields");
                verify.AreEqual(0, publicProperty.CalculatedFields.Length, "not used in calculated fields");
                verify.IsTrue(publicProperty.CanRead, "CanRead");
                verify.IsTrue(publicProperty.CanWrite, "CanWrite");
                verify.AreEqual("PublicProperty", publicProperty.Name, "Name");
                verify.AreEqual("PublicProperty", publicProperty.PropertyChangedEventArgs.PropertyName, "PropertyName");
                verify.AreEqual(typeof(int), publicProperty.PropertyType, "PropertyType");

                verify.AreEqual(0, publicProperty.Validators.Length, "not used in validation");

                verify.IsTrue(result.Constructors.HasDefaultConstructor, "this should have a automatically implemented default constructor");
            }
        }
开发者ID:docevaad,项目名称:Anchor,代码行数:22,代码来源:MetadataCacheTests.cs

示例8: MetadataCache_Constructors_Test

        public void MetadataCache_Constructors_Test()
        {
            using (var verify = new Verify())
            {

                var result  = MetadataCache.GetMetadata(typeof(MultiConstructor));

                var a = result.Constructors.Find(typeof(int));
                var b = result.Constructors.Find(typeof(string));
                var c = result.Constructors.Find(typeof(int), typeof(string));
                var d = result.Constructors.Find(typeof(long), typeof(string));

                verify.IsNotNull(a, "int");
                verify.IsNotNull(b, "string");
                verify.IsNotNull(c, "int, string");
                verify.IsNull(d, "long, string shouldn't exist");
            }
        }
开发者ID:docevaad,项目名称:Anchor,代码行数:18,代码来源:MetadataCacheTests.cs


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