public void log_an_object_creates_a_log_file()
        {
            var loader = new StubPackageLoader("a", "b");
            diagnostics.LogObject(loader, "registered at XYZ");

            diagnostics.LogFor(loader).Provenance.ShouldEqual("registered at XYZ");
        }
        public void log_an_object_sticks_the_ToString_value_of_the_object_on_to_the_description()
        {
            var loader = new StubPackageLoader("a", "b");
            diagnostics.LogObject(loader, "registered at XYZ");

            diagnostics.LogFor(loader).Description.ShouldEqual(loader.ToString());
        }
Esempio n. 3
0
        public void log_an_object_creates_a_log_file()
        {
            var loader = new StubPackageLoader("a", "b");

            diagnostics.LogObject(loader, "registered at XYZ");

            diagnostics.LogFor(loader).Provenance.ShouldEqual("registered at XYZ");
        }
Esempio n. 4
0
        public void log_an_object_sticks_the_ToString_value_of_the_object_on_to_the_description()
        {
            var loader = new StubPackageLoader("a", "b");

            diagnostics.LogObject(loader, "registered at XYZ");

            diagnostics.LogFor(loader).Description.ShouldEqual(loader.ToString());
        }
Esempio n. 5
0
        public void SetUp()
        {
            diagnostics = new PackagingDiagnostics();

            loader  = new StubPackageLoader("a", "b");
            package = new StubPackage("a");

            diagnostics.LogPackage(package, loader);
        }
Esempio n. 6
0
        public void SetUp()
        {
            diagnostics = new BottlingDiagnostics(new LoggingSession());

            loader  = new StubPackageLoader("a", "b");
            _bottle = new StubBottle("a");

            diagnostics.LogPackage(_bottle, loader);
        }
        private void loadPackages(Action <StubPackageLoader> configuration)
        {
            PackageRegistry.LoadPackages(facility =>
            {
                var loader = new StubPackageLoader();
                configuration(loader);

                facility.Loader(loader);
            });
        }
        public void log_execution_happy_path()
        {
            var loader = new StubPackageLoader("a", "b");
            diagnostics.LogObject(loader, "registered at XYZ");

            diagnostics.LogExecution(loader, () => { });

            var log = diagnostics.LogFor(loader);
            log.Success.ShouldBeTrue();
        }
        private void loadPackages(Action<StubPackageLoader> configuration)
        {
            PackageRegistry.LoadPackages(facility =>
            {
                var loader = new StubPackageLoader();
                configuration(loader);

                facility.Loader(loader);
            });
        }
Esempio n. 10
0
        public void log_execution_happy_path()
        {
            var loader = new StubPackageLoader("a", "b");
            diagnostics.LogObject(loader, "registered at XYZ");

            diagnostics.LogExecution(loader, () => Thread.Sleep(5));

            var log = diagnostics.LogFor(loader);
            log.Success.ShouldBeTrue();
            log.TimeInMilliseconds.ShouldBeGreaterThan(0);
        }
Esempio n. 11
0
        public void log_execution_happy_path()
        {
            var loader = new StubPackageLoader("a", "b");

            diagnostics.LogObject(loader, "registered at XYZ");

            diagnostics.LogExecution(loader, () => { });

            var log = diagnostics.LogFor(loader);

            log.Success.ShouldBeTrue();
        }
Esempio n. 12
0
        public void SetUp()
        {
            loader1 = new StubPackageLoader("1a", "1b", "1c");
            loader2 = new StubPackageLoader("2a", "2b");
            loader3 = new StubPackageLoader("3a", "3b", "3c");

            ClassUnderTest.AddLoader(loader1);
            ClassUnderTest.AddLoader(loader2);
            ClassUnderTest.AddLoader(loader3);

            ClassUnderTest.DiscoverAndLoadPackages(() => { });
        }
Esempio n. 13
0
        public void log_execution_happy_path()
        {
            var loader = new StubPackageLoader("a", "b");

            diagnostics.LogObject(loader, "registered at XYZ");

            diagnostics.LogExecution(loader, () => Thread.Sleep(5));

            var log = diagnostics.LogFor(loader);

            log.Success.ShouldBeTrue();
            log.TimeInMilliseconds.ShouldBeGreaterThan(0);
        }
Esempio n. 14
0
        protected override void beforeEach()
        {
            loader1 = new StubPackageLoader("1a", "1b", "1c");
            loader2 = new StubPackageLoader("2a", "2b");
            loader3 = new StubPackageLoader("3a", "3b", "3c");

            ClassUnderTest.PushProvenance("A");
            ClassUnderTest.AddLoader(loader1);

            ClassUnderTest.PushProvenance("B");
            ClassUnderTest.AddLoader(loader2);

            ClassUnderTest.PopProvenance();
            ClassUnderTest.AddLoader(loader3);
        }
Esempio n. 15
0
        public void log_execution_that_throws_exception()
        {
            var loader = new StubPackageLoader("a", "b");
            diagnostics.LogObject(loader, "registered at XYZ");

            diagnostics.LogExecution(loader, () =>
            {
                Thread.Sleep(5);
                throw new ApplicationException("not gonna happen");
            });

            var log = diagnostics.LogFor(loader);
            log.Success.ShouldBeFalse();
            log.TimeInMilliseconds.ShouldBeGreaterThan(0);
            log.FullTraceText().ShouldContain("not gonna happen");
        }
Esempio n. 16
0
        public void log_execution_that_throws_exception()
        {
            var loader = new StubPackageLoader("a", "b");

            diagnostics.LogObject(loader, "registered at XYZ");

            diagnostics.LogExecution(loader, () =>
            {
                Thread.Sleep(5);
                throw new ApplicationException("not gonna happen");
            });

            var log = diagnostics.LogFor(loader);

            log.Success.ShouldBeFalse();
            log.TimeInMilliseconds.ShouldBeGreaterThan(0);
            log.FullTraceText().ShouldContain("not gonna happen");
        }
        public void find_children()
        {
            var log = new PackageLog();

            var loader1 = new StubPackageLoader();
            var loader2 = new StubPackageLoader();
            var loader3 = new StubPackageLoader();

            var package1 = new StubPackage("1");
            var package2 = new StubPackage("2");
            var package3 = new StubPackage("3");

            log.AddChild(loader1, loader2, loader3, package1, package2, package3);

            log.FindChildren<IPackageLoader>().ShouldHaveTheSameElementsAs(loader1, loader2, loader3);

            log.FindChildren<IPackageInfo>().ShouldHaveTheSameElementsAs(package1, package2, package3);
        }
Esempio n. 18
0
        public void find_children()
        {
            var log = new PackageRegistryLog();

            var loader1 = new StubPackageLoader();
            var loader2 = new StubPackageLoader();
            var loader3 = new StubPackageLoader();

            var package1 = new StubPackage("1");
            var package2 = new StubPackage("2");
            var package3 = new StubPackage("3");

            log.AddChild(loader1, loader2, loader3, package1, package2, package3);

            log.FindChildren <IPackageLoader>().ShouldHaveTheSameElementsAs(loader1, loader2, loader3);

            log.FindChildren <IPackageInfo>().ShouldHaveTheSameElementsAs(package1, package2, package3);
        }
        protected override void beforeEach()
        {
            diagnostics = new StubBottleDiagnostics();
            Services.Inject <IBottlingDiagnostics>(diagnostics);

            loader1 = new StubPackageLoader("1a", "1b", "1c");
            loader2 = new StubPackageLoader("2a", "2b");
            loader3 = new StubPackageLoader("1a", "2b");

            ClassUnderTest.PushProvenance("A");
            ClassUnderTest.AddLoader(loader1);

            ClassUnderTest.PushProvenance("B");
            ClassUnderTest.AddLoader(loader2);

            ClassUnderTest.PopProvenance();
            ClassUnderTest.AddLoader(loader3);

            foundPackages = ClassUnderTest.FindAllPackages();
        }
        public void SetUp()
        {
            diagnostics = new BottlingDiagnostics(new LoggingSession());

            loader = new StubPackageLoader("a", "b");
            _bottle = new StubBottle("a");

            diagnostics.LogPackage(_bottle, loader);
        }
Esempio n. 21
0
        public void SetUp()
        {
            diagnostics = new PackagingDiagnostics();

            loader = new StubPackageLoader("a", "b");
            package = new StubPackage("a");

            diagnostics.LogPackage(package, loader);
        }