예제 #1
0
        public void SetOptions_WithDefaultArgumentSeperatorTest()
        {
            string defaultArgumentSeperator = "-";

            var cpbpModule = new CpbpModule()
                             .SetOptions(
                x =>
            {
                x.Requirements(
                    assemblies: assemblies,
                    args: args
                    );
            }
                );

            Assert.AreEqual(defaultArgumentSeperator, cpbpModule.ArgumentSeperator);
        }
예제 #2
0
        public void SetOptions_WithSpecificArgumentSeperatorTest()
        {
            string argumentSeperator = "/";

            var cpbpModule = new CpbpModule()
                             .SetOptions(
                x =>
            {
                x.Requirements(
                    assemblies: assemblies,
                    args: args
                    );
                x.WithArgumentSeperator(argumentSeperator);
            }
                );

            Assert.AreEqual(argumentSeperator, cpbpModule.ArgumentSeperator);
        }
예제 #3
0
        public void SetOptions_WithContainerTest()
        {
            Container container = new Container();

            container.Register(typeof(Models.TestModel));

            var cpbpModule = new CpbpModule()
                             .SetOptions(
                x =>
            {
                x.Requirements(
                    assemblies: assemblies,
                    args: args
                    );
                x.WithContainer(container);
            }
                );

            Assert.AreEqual(container, cpbpModule.IocContainer);
        }
예제 #4
0
        public void SetOptions_RequirementsTest()
        {
            Dictionary <string, string> applicationParameters =
                new Dictionary <string, string>
            {
                { args[1], args[2] }
            };

            var cpbpModule = new CpbpModule()
                             .SetOptions(
                x =>
            {
                x.Requirements(
                    assemblies: assemblies,
                    args: args
                    );
            }
                );

            Assert.AreEqual(assemblies, cpbpModule.Assemblies);
            Assert.AreEqual(applicationParameters.ContainsKey(args[1]), cpbpModule.ApplicationParameters.ContainsKey(args[1]));
            Assert.AreEqual(applicationParameters.ContainsValue(args[2]), cpbpModule.ApplicationParameters.ContainsValue(args[2]));
        }