Example #1
0
        public void PropertyErrorNormalBehavior()
        {
            // Test read access of 'Error' Property.
            var actual = testObject.Error;

            Assert.IsNull(actual);

            method.StaticClass("Assert").Invoke("Inconclusive").With("Thisone").Commit();

            testObject.Expression <CodeMethodInvokeExpression>(Is.MethodNamed("MethodName"));
            var expected = "[0]By comparing System.CodeDom.CodeMethodInvokeExpression´s contained " +
                           "in System.CodeDom.CodeExpressionStatement  elements, the value `MethodName` was not " +
                           "found in the checked items: [{Inconclusive}]\r\n";

            actual = testObject.Error;
            Assert.AreEqual(expected, actual);

            expected = "[0]By comparing System.CodeDom.CodeMethodInvokeExpression´s contained in System.CodeDom" +
                       ".CodeExpressionStatement  elements, the value `MethodName` was not found in the checked items: " +
                       "[{Inconclusive}]\r\n[1]WasFound(> 0) on 1 total items with 0 found items.\r\n[2]Auto WasFound() called.\r\n";
            var result = testObject.Assert();

            actual = testObject.Error;
            Assert.AreEqual(expected, actual);

            result.Compile().Invoke();

            actual = testObject.Error;
            Assert.AreEqual(expected, actual);
        }