Esempio n. 1
0
 [ExcludeFromCodeCoverage]         // Unreachable defensive code
 internal static void AssertNotStarted(TestOperationStatus status)
 {
     if (status != NotExecuted.Instance)
     {
         throw new InvalidOperationException(
                   $"Operation already started ({status?.GetType().Name})");
     }
 }
Esempio n. 2
0
 [ExcludeFromCodeCoverage]         // Unreachable defensive code
 private Waiting ExpectWaiting(TestOperationStatus status)
 {
     if (status is Waiting waiting)
     {
         return(waiting);
     }
     else
     {
         throw new InvalidOperationException(
                   $"Can not transition from {status.GetType().Name} to {this.GetType().Name}");
     }
 }