コード例 #1
0
 public void ShouldCreatedAnInstanceOfServiceReporter() {
   var factory = new ServiceReporterFactory();
   var options = new Dictionary<string, string> {
     {ServiceReporterFactory.kServerEndpoint, "tcp://127.0.0.1:8520"},
   };
   var reporter = factory.CreatePollingReporter(options);
   Assert.That(reporter, Is.AssignableTo<ServiceReporter>());
 }
コード例 #2
0
 public void ShouldCreateAnInstanceOfDynamicReporter() {
   var host = Mock.Create<IRubyServiceHost>();
   var factory = new ServiceReporterFactory(host);
   var options = new Dictionary<string, string> {
     {ServiceReporterFactory.kServerEndpoint, "tcp://127.0.0.1:8520"},
   };
   var reporter = factory.CreatePollingReporter(options);
   Assert.That(reporter, Is.AssignableTo<DynamicServiceReporter>());
 }
コード例 #3
0
        public void ShouldCreatedAnInstanceOfServiceReporter()
        {
            var factory = new ServiceReporterFactory();
            var options = new Dictionary <string, string> {
                { ServiceReporterFactory.kServerEndpoint, "tcp://127.0.0.1:8520" },
            };
            var reporter = factory.CreatePollingReporter(options);

            Assert.That(reporter, Is.AssignableTo <ServiceReporter>());
        }
コード例 #4
0
        public void ShouldCreateAnInstanceOfDynamicReporter()
        {
            var host    = Mock.Create <IRubyServiceHost>();
            var factory = new ServiceReporterFactory(host);
            var options = new Dictionary <string, string> {
                { ServiceReporterFactory.kServerEndpoint, "tcp://127.0.0.1:8520" },
            };
            var reporter = factory.CreatePollingReporter(options);

            Assert.That(reporter, Is.AssignableTo <DynamicServiceReporter>());
        }
コード例 #5
0
 public void ShouldThrowExceptionWhenRequiredOptionIsMissing() {
   var factory = new ServiceReporterFactory();
   var options = new Dictionary<string, string>();
   try {
     var reporter = factory.CreatePollingReporter(options);
   } catch(Exception e) {
     Assert.Pass("Exception was throwed");
     return;
   }
   Assert.Fail("Exception was not throwed");
 }
コード例 #6
0
        public void ShouldThrowExceptionWhenRequiredOptionIsMissing()
        {
            var factory = new ServiceReporterFactory();
            var options = new Dictionary <string, string>();

            try {
                var reporter = factory.CreatePollingReporter(options);
            } catch (Exception e) {
                Assert.Pass("Exception was throwed");
                return;
            }
            Assert.Fail("Exception was not throwed");
        }