Exemplo n.º 1
0
 protected CompilerTestException(
     TestCaseError reason,
     SerializationInfo info,
     StreamingContext context) : base(info, context)
 {
     Reason = reason;
 }
Exemplo n.º 2
0
        public void ValidateFrameworkDateTimeImplementationContract(String testFormat)
        {
            List <TestCaseError> incorrectResults = new List <TestCaseError>();

            foreach (HdDateTime testValue in TestHdDateDates)
            {
                String   source      = testValue.ToString(testFormat);
                DateTime parsedValue = DateTime.Parse(source);

                if (testValue.DateTime != parsedValue)
                {
                    Int64 nanoseconds = testValue.EpochNanoseconds;
                    Int64 testTicks   = testValue.DateTime.Ticks;
                    Int64 parsedTicks = parsedValue.Ticks;

                    // remove loose precision
                    if (testTicks - parsedTicks == -1 && (nanoseconds % 100 >= 50))
                    {
                    }
                    else
                    {
                        TestCaseError error = new TestCaseError()
                        {
                            Nanoseconds = nanoseconds,
                            TestTicks   = testTicks,
                            ParsedTicks = parsedTicks,
                            Format      = testFormat,
                            Source      = source
                        };
                        incorrectResults.Add(error);
                    }
                }
            }

            Assert.IsTrue(incorrectResults.Count == 0);
        }
Exemplo n.º 3
0
 public CompilerTestException(TestCaseError reason, string message, Exception inner) : base(message, inner)
 {
     Reason = reason;
 }
Exemplo n.º 4
0
 public CompilerTestException(TestCaseError reason)
 {
     Reason = reason;
 }