コード例 #1
0
 public void Concrete()
 {
     // GKState is an abstract type - but it does implement IsValidNextState (and accept anything)
     using (var s1 = new ValidState())
         using (var s2 = new InvalidState()) {
             Assert.True(s2.IsValidNextState(s2), "self");
             Assert.True(s2.IsValidNextState(s1), "different");
         }
 }
コード例 #2
0
 public void NullIsValidNextState()
 {
     // this will test the (manual) binding code (and not the test implementation)
     using (var state = new InvalidState()) {
         Assert.Throws <ArgumentNullException> (delegate { state.IsValidNextState((Class)null); }, "Class");
         Assert.Throws <ArgumentNullException> (delegate { state.IsValidNextState((Type)null); }, "Type");
         Assert.Throws <ArgumentNullException> (delegate { state.IsValidNextState((GKState)null); }, "Instance");
     }
 }