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


C# RealAssert.That方法代码示例

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


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

示例1: that_test_delegate_e_expression_e_array_de_object_deve_retornar_excecao_de_expressao

        public void that_test_delegate_e_expression_e_array_de_object_deve_retornar_excecao_de_expressao()
        {
            string message = string.Empty;

            try
            {
                IAssert assert = new RealAssert();
                object[] lista = new object[0];
                ResolvableConstraintExpression expression = new ResolvableConstraintExpression();
                TestDelegate del = new TestDelegate(FazerNada);

                assert.That(del, expression);
            }
            catch (Exception ex)
            {
                message = ex.Message;
            }

            Assert.AreEqual(message, "A partial expression may not be resolved");
        }
开发者ID:Workker,项目名称:EntregaRergressaoTestes,代码行数:20,代码来源:RealAssertTest.cs

示例2: that_object_ref_e_expression_mensagem_e_aray_de_object_deve_retornar_excecao_de_expressao

        public void that_object_ref_e_expression_mensagem_e_aray_de_object_deve_retornar_excecao_de_expressao()
        {
            string message = string.Empty;

            try
            {
                IAssert assert = new RealAssert();
                object[] lista = new object[0];
                ResolvableConstraintExpression expression = new ResolvableConstraintExpression();

                assert.That(ref assert, expression, "mensagem", lista);
            }
            catch (Exception ex)
            {
                message = ex.Message;
            }

            Assert.AreEqual(message, "A partial expression may not be resolved");
        }
开发者ID:Workker,项目名称:EntregaRergressaoTestes,代码行数:19,代码来源:RealAssertTest.cs

示例3: that_generico__deve_retornar_excecao_de_expressao

        public void that_generico__deve_retornar_excecao_de_expressao()
        {
            string message = string.Empty;

            try
            {
                IAssert assert = new RealAssert();
                ResolvableConstraintExpression expression = new ResolvableConstraintExpression();

                assert.That<IAssert>(ref assert, expression);
            }
            catch (Exception ex)
            {
                message = ex.Message;
            }

            Assert.AreEqual(message, "A partial expression may not be resolved");
        }
开发者ID:Workker,项目名称:EntregaRergressaoTestes,代码行数:18,代码来源:RealAssertTest.cs

示例4: that_e_true_com_actual_value_delegate_e_array_de_object_e_mensagem_deve_retornar_excecao_de_expressao

        public void that_e_true_com_actual_value_delegate_e_array_de_object_e_mensagem_deve_retornar_excecao_de_expressao()
        {
            string message = string.Empty;

            try
            {
                IAssert assert = new RealAssert();
                object[] lista = new object[0];
                ActualValueDelegate del = new ActualValueDelegate(SuportDelegate);
                ResolvableConstraintExpression expression = new ResolvableConstraintExpression();

                assert.That(del, expression, "jhghjg");
            }
            catch (Exception ex)
            {
                message = ex.Message;
            }

            Assert.AreEqual(message, "A partial expression may not be resolved");
        }
开发者ID:Workker,项目名称:EntregaRergressaoTestes,代码行数:20,代码来源:RealAssertTest.cs

示例5: that_e_falso_nao_deve_retornar_execao

        public void that_e_falso_nao_deve_retornar_execao()
        {
            string message = string.Empty;

            try
            {
                IAssert assert = new RealAssert();

                assert.That(true);
            }
            catch (Exception ex)
            {
                message = ex.Message;
            }

            Assert.AreEqual(message, "Exception of type 'System.Exception' was thrown.");
        }
开发者ID:Workker,项目名称:EntregaRergressaoTestes,代码行数:17,代码来源:RealAssertTest.cs

示例6: that_e_falso_com_mensagem_e_array_de_object_nao_deve_retornar_execao

        public void that_e_falso_com_mensagem_e_array_de_object_nao_deve_retornar_execao()
        {
            string message = string.Empty;

            try
            {
                IAssert assert = new RealAssert();
                object[] lista = new object[0];

                assert.That(true, "mensagem", lista);
            }
            catch (Exception ex)
            {
                message = ex.Message;
            }

            Assert.AreEqual(message, "Exception of type 'System.Exception' was thrown.");
        }
开发者ID:Workker,项目名称:EntregaRergressaoTestes,代码行数:18,代码来源:RealAssertTest.cs


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