Esempio n. 1
0
        private void QueueAttempt(string completionTimeStr, string trackingIdStr, string voyageNumberStr,
                                  string unLocodeStr, string eventTypeStr)
        {
            var errors = new List <string>();

            DateTime     date         = HandlingReportParser.ParseDate(completionTimeStr, errors);
            TrackingId   trackingId   = HandlingReportParser.ParseTrackingId(trackingIdStr, errors);
            VoyageNumber voyageNumber = HandlingReportParser.ParseVoyageNumber(voyageNumberStr, errors);
            HandlingType eventType    = HandlingReportParser.ParseEventType(eventTypeStr, errors);
            UnLocode     unLocode     = HandlingReportParser.ParseUnLocode(unLocodeStr, errors);

            if (errors.IsEmpty())
            {
                var attempt = new HandlingEventRegistrationAttempt(DateTime.Now, date,
                                                                   trackingId, voyageNumber,
                                                                   eventType, unLocode);
                AppEvents.ReceivedHandlingEventRegistrationAttempt(attempt);
            }
            else
            {
                throw new Exception(ToStringBuilder.ReflectionToString(errors));
            }
        }
Esempio n. 2
0
 public override string ToString()
 {
     return(ToStringBuilder.ReflectionToString(this));
 }
 public void CanLogType()
 {
     Assert.IsTrue(
         ToStringBuilder.ReflectionToString(new TestSubObject(100, 999)).Contains(
             typeof(TestSubObject).ToString()));
 }
 public void CanLogDerived()
 {
     Assert.IsTrue(ToStringBuilder.ReflectionToString(new TestSubObject(100, 999)).Contains("100"));
     Assert.IsTrue(ToStringBuilder.ReflectionToString(new TestSubObject(100, 999)).Contains("999"));
 }
 public void CanLogSimpleObject()
 {
     Assert.IsTrue(ToStringBuilder.ReflectionToString(new TestObject(100)).Contains("100"));
 }
 public void CanLogNull()
 {
     Assert.IsNotNull(ToStringBuilder.ReflectionToString(null));
 }