Exemple #1
0
        public void MapTester_exception_should_prettify_ScenarioTestFailureException()
        {
            var source = new Source();
            var dummy  = new Dummy();

            string[] destPropertyNames =
                PropertyEnumerator.GetPublicInstanceReadWriteProperties(typeof(Dummy).GetTypeInfo()).Select(x => x.Name).ToArray();
            int propertyCount = destPropertyNames.Length;

            string message = string.Empty;

            try
            {
                MapTester.ForMap <Source, Dummy>().AssertMappedValues(source, dummy);
            }
            catch (MapTesterException ex)
            {
                message = ex.Message;
            }

            StringAssert.Contains(message, $"{propertyCount} properties tested. 0 passed. {propertyCount} failed.");
            StringAssert.DoesNotMatch(message, new Regex("cenario"));
        }