Пример #1
0
        public void When_run_on_an_assembly()
        {
            var stage = new ServiceMetadataStage(typeof(ServiceMetadataStage).Assembly);

            stage.OnStart(_stageArgs);

            Metadata.ShouldSatisfyAllConditions(
                () => Metadata.Name.ShouldBe("KickOff"),
                () => Metadata.Description.ShouldBe("Microservice bootstrapping pipeline")
                );
        }
Пример #2
0
        public void When_there_is_no_name_attribute()
        {
            var stage = new ServiceMetadataStage(new Attribute[]
            {
                new AssemblyDescriptionAttribute("desc"),
            });

            stage.OnStart(_stageArgs);

            Metadata.Description.ShouldBe("desc");
        }
Пример #3
0
        public void When_there_is_no_description_attribute()
        {
            var stage = new ServiceMetadataStage(new Attribute[]
            {
                new AssemblyTitleAttribute("title"),
            });

            stage.OnStart(_stageArgs);

            Metadata.Name.ShouldBe("title");
        }
Пример #4
0
        public void When_there_are_no_attributes()
        {
            var stage = new ServiceMetadataStage(new Attribute[] { });

            stage.OnStart(_stageArgs);

            Metadata.ShouldSatisfyAllConditions(
                () => Metadata.Name.ShouldBe(string.Empty),
                () => Metadata.Description.ShouldBe(string.Empty)
                );
        }
Пример #5
0
        public void When_there_are_both_attributes()
        {
            var stage = new ServiceMetadataStage(new Attribute[]
            {
                new AssemblyTitleAttribute("title"),
                new AssemblyDescriptionAttribute("desc"),
            });

            stage.OnStart(_stageArgs);

            Metadata.ShouldSatisfyAllConditions(
                () => Metadata.Name.ShouldBe("title"),
                () => Metadata.Description.ShouldBe("desc")
                );
        }