Exemplo n.º 1
0
        public void ModuleGetVisitedCodeLength_FooModule_ReturnsTotalLengthOfAllVisitedMethodSequencePoints()
        {
            int length         = FooModule.GetVisitedCodeLength();
            int expectedLength = 4;

            Assert.AreEqual(expectedLength, length);
        }
        public void ModuleGetUnvisitedCodeLength_FooModule_ReturnsTotalLengthOfAllNonVisitedMethodSequencePoints()
        {
            Assert.Inconclusive("SequencePoint.Length is computed from text-source not present in this test");
            int length         = FooModule.GetUnvisitedCodeLength();
            int expectedLength = 2;

            Assert.AreEqual(expectedLength, length);
        }
        public void Given_Module_AddConfiguration_ShouldReturn_Result()
        {
            var module = new FooModule();

            var builder = this._fixture.ArrangeAutofacJobHostBuilder(module);

            builder.AddConfiguration(p => p.UseDevelopmentSettings());

            var result = typeof(JobHostBuilder).GetField("_config", BindingFlags.Instance | BindingFlags.NonPublic)
                         .GetValue(builder) as IJobHostConfigurationBuilder;

            result.Build().Tracing.ConsoleLevel.Should().Be(TraceLevel.Verbose);
        }
        public void Given_Module_BuildHost_ShouldReturn_Result()
        {
            var module = new FooModule();

            var builder = this._fixture.ArrangeAutofacJobHostBuilder(module);

            builder.BuildHost();

            var result = typeof(JobHostBuilder).GetField("_host", BindingFlags.Instance | BindingFlags.NonPublic)
                         .GetValue(builder);

            result.Should().NotBeNull();
            result.Should().BeOfType <JobHost>();
        }