public void Services() { // By default there are no services WorkflowRuntime wr = new WorkflowRuntime(); Assert.AreEqual(0, (wr.GetAllServices(typeof(WorkflowLoaderService))).Count, "C1#1"); //Assert.AreEqual (0, (wr.GetAllServices (typeof (WorkflowPersistenceService))).Count, "C1#2"); //Assert.AreEqual (0, (wr.GetAllServices (typeof (WorkflowQueuingService))).Count, "C1#3"); // Can have to diferent instances of the same class WorkflowRuntime wr3 = new WorkflowRuntime(); WorkflowLoaderServiceTest1 wls = new WorkflowLoaderServiceTest1(); wr3.AddService(wls); Assert.AreEqual(wls, wr3.GetService(typeof(WorkflowLoaderService)), "C1#2"); wr3.AddService(new WorkflowLoaderServiceTest1()); Assert.AreEqual(2, (wr3.GetAllServices(typeof(WorkflowLoaderService))).Count, "C1#3"); Assert.AreEqual(2, wr3.GetAllServices <WorkflowLoaderService> ().Count, "C1#3"); // An non-existant service should return null Assert.AreEqual(null, wr3.GetService(typeof(string)), "C1#4"); wr.AddService(new WorkflowLoaderServiceTest1()); //foreach (object t in wr.GetAllServices (typeof (WorkflowLoaderService))) { // Console.WriteLine ("Types {0}", t.GetType ()); //} }
public void RemoveUnexistantService() { WorkflowRuntime wr = new WorkflowRuntime(); WorkflowLoaderServiceTest1 wl = new WorkflowLoaderServiceTest1(); wr.RemoveService(wl); }
public void AddServiceTwice() { WorkflowRuntime wr = new WorkflowRuntime(); WorkflowLoaderServiceTest1 wl = new WorkflowLoaderServiceTest1(); wr.AddService(wl); wr.AddService(wl); }
public void GetServiceWithTwoB() { WorkflowRuntime wr = new WorkflowRuntime(); WorkflowLoaderServiceTest1 wl = new WorkflowLoaderServiceTest1(); WorkflowLoaderServiceTest2 w2 = new WorkflowLoaderServiceTest2(); wr.AddService(wl); wr.AddService(w2); wr.GetService <WorkflowLoaderService> (); }
public void Services () { // By default there are no services WorkflowRuntime wr = new WorkflowRuntime (); Assert.AreEqual (0, (wr.GetAllServices (typeof (WorkflowLoaderService))).Count, "C1#1"); //Assert.AreEqual (0, (wr.GetAllServices (typeof (WorkflowPersistenceService))).Count, "C1#2"); //Assert.AreEqual (0, (wr.GetAllServices (typeof (WorkflowQueuingService))).Count, "C1#3"); // Can have to diferent instances of the same class WorkflowRuntime wr3 = new WorkflowRuntime (); WorkflowLoaderServiceTest1 wls = new WorkflowLoaderServiceTest1 (); wr3.AddService (wls); Assert.AreEqual (wls, wr3.GetService (typeof (WorkflowLoaderService)), "C1#2"); wr3.AddService (new WorkflowLoaderServiceTest1 ()); Assert.AreEqual (2, (wr3.GetAllServices (typeof (WorkflowLoaderService))).Count, "C1#3"); Assert.AreEqual (2, wr3.GetAllServices <WorkflowLoaderService> ().Count, "C1#3"); // An non-existant service should return null Assert.AreEqual (null, wr3.GetService (typeof (string)), "C1#4"); wr.AddService (new WorkflowLoaderServiceTest1 ()); //foreach (object t in wr.GetAllServices (typeof (WorkflowLoaderService))) { // Console.WriteLine ("Types {0}", t.GetType ()); //} }
public void GetServiceWithTwoB () { WorkflowRuntime wr = new WorkflowRuntime (); WorkflowLoaderServiceTest1 wl = new WorkflowLoaderServiceTest1 (); WorkflowLoaderServiceTest2 w2 = new WorkflowLoaderServiceTest2 (); wr.AddService (wl); wr.AddService (w2); wr.GetService <WorkflowLoaderService> (); }
public void RemoveUnexistantService () { WorkflowRuntime wr = new WorkflowRuntime (); WorkflowLoaderServiceTest1 wl = new WorkflowLoaderServiceTest1 (); wr.RemoveService (wl); }
public void AddServiceTwice () { WorkflowRuntime wr = new WorkflowRuntime (); WorkflowLoaderServiceTest1 wl = new WorkflowLoaderServiceTest1 (); wr.AddService (wl); wr.AddService (wl); }