예제 #1
0
        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 ());
            //}
        }
예제 #2
0
        public void RemoveUnexistantService()
        {
            WorkflowRuntime            wr = new WorkflowRuntime();
            WorkflowLoaderServiceTest1 wl = new WorkflowLoaderServiceTest1();

            wr.RemoveService(wl);
        }
예제 #3
0
        public void AddServiceTwice()
        {
            WorkflowRuntime            wr = new WorkflowRuntime();
            WorkflowLoaderServiceTest1 wl = new WorkflowLoaderServiceTest1();

            wr.AddService(wl);
            wr.AddService(wl);
        }
예제 #4
0
        public void GetServiceWithTwoB()
        {
            WorkflowRuntime            wr = new WorkflowRuntime();
            WorkflowLoaderServiceTest1 wl = new WorkflowLoaderServiceTest1();
            WorkflowLoaderServiceTest2 w2 = new WorkflowLoaderServiceTest2();

            wr.AddService(wl);
            wr.AddService(w2);
            wr.GetService <WorkflowLoaderService> ();
        }
예제 #5
0
		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 ());
			//}
		}
예제 #6
0
		public void GetServiceWithTwoB ()
		{
			WorkflowRuntime wr = new WorkflowRuntime ();
			WorkflowLoaderServiceTest1 wl = new WorkflowLoaderServiceTest1 ();
			WorkflowLoaderServiceTest2 w2 = new WorkflowLoaderServiceTest2 ();
			wr.AddService (wl);
			wr.AddService (w2);
			wr.GetService <WorkflowLoaderService> ();
		}
예제 #7
0
		public void RemoveUnexistantService ()
		{
			WorkflowRuntime wr = new WorkflowRuntime ();
			WorkflowLoaderServiceTest1 wl = new WorkflowLoaderServiceTest1 ();
			wr.RemoveService (wl);
		}
예제 #8
0
		public void AddServiceTwice ()
		{
			WorkflowRuntime wr = new WorkflowRuntime ();
			WorkflowLoaderServiceTest1 wl = new WorkflowLoaderServiceTest1 ();
			wr.AddService (wl);
			wr.AddService (wl);
		}