/// <summary> /// Assert that the breakable service has entered a state exactly the number /// of time asserted. /// </summary> /// <param name="service">service -if null an assertion is raised.</param> /// <param name="state">state to check.</param> /// <param name="expected">expected count.</param> public static void AssertStateCount(BreakableService service, Service.STATE state , int expected) { NUnit.Framework.Assert.IsNotNull("Null service", service); int actual = service.GetCount(state); if (expected != actual) { NUnit.Framework.Assert.Fail("Expected entry count for state [" + state + "] of " + service + " to be " + expected + " but was " + actual); } }