Esempio n. 1
0
        public void TestGetTaskScheduler4()
        {
            var      subject = new Mock <IInvokeAttributeMethods>();
            IServant servant = TestGenerate(subject.Object);

            var scheduler = servant.GetTaskScheduler("SerializePerObject1");

            scheduler.Should().NotBeNull();
            scheduler.Should().BeOfType <SerialTaskScheduler>();

            scheduler.Should().BeSameAs(servant.GetTaskScheduler("SerializePerObject2"));
        }
Esempio n. 2
0
        public void TestGetTaskScheduler6()
        {
            var      subject = new Mock <IInvokeAttributeMethods>();
            IServant servant = TestGenerate(subject.Object);

            new Action(() => servant.GetTaskScheduler("DoesntExist"))
            .Should().Throw <ArgumentException>();
        }
Esempio n. 3
0
        public void TestGetTaskScheduler2()
        {
            var      subject = new Mock <IInvokeAttributeMethods>();
            IServant servant = TestGenerate(subject.Object);

            servant.GetTaskScheduler("DoNotSerialize")
            .Should().BeNull();
        }
Esempio n. 4
0
        public void TestGetTaskScheduler5()
        {
            var      subject  = new Mock <IInvokeAttributeMethods>();
            IServant servant1 = TestGenerate(subject.Object);
            IServant servant2 = TestGenerate(subject.Object);

            var scheduler = servant1.GetTaskScheduler("SerializePerMethod1");

            scheduler.Should().NotBeNull();
            scheduler.Should().BeOfType <SerialTaskScheduler>();

            scheduler.Should()
            .NotBeSameAs(servant1.GetTaskScheduler("SerializePerMethod2"),
                         "because Dispatch.SerializePerMethod shall behave exactly like Java's synchronized statement");
            scheduler.Should()
            .NotBeSameAs(servant2.GetTaskScheduler("SerializePerMethod1"),
                         "because Dispatch.SerializePerMethod shall behave exactly like Java's synchronized statement");
        }