Exemplo n.º 1
0
        public static void ShouldMatch <T>(this ExpectedObject expected, T actual)
        {
            IWriter writer = new ShouldWriter();

            if (!expected.Equals(actual, writer, true))
            {
                var results = writer.GetFormattedResults();
                throw new ComparisonException(results);
            }
        }
Exemplo n.º 2
0
        public static void ShouldEqual <T>(this ExpectedObject expected, T actual)
        {
            IWriter writer = new ShouldWriter();

            if (!expected.Equals(actual, writer))
            {
                var results = writer.GetFormattedResults();

                if (!string.IsNullOrEmpty(results))
                {
                    throw new ComparisonException(results);
                }
            }
        }