コード例 #1
0
ファイル: With_load.cs プロジェクト: perryofpeek/CCSkype
        public void Should_load_multiple_different_configration_into_internal_config()
        {
            var config = new Configuration();
            config.Items = new ConfigurationPipeline[2];
            config.Items[0] = new ConfigurationPipeline { name = "name0", users = MakeUsersUserArray(new List<string>() { "dave0", "fish" }) };
            config.Items[1] = new ConfigurationPipeline { name = "name1", users = MakeUsersUserArray(new List<string>() { "dave1" }) };

            var intConfig = new InternalConfiguration(config);
            Assert.That(intConfig.Items["name0"], Is.Not.Null);
            Assert.That(intConfig.Items["name1"], Is.Not.Null);
            Assert.That(intConfig.Items["name0"].Contains("dave0"), Is.True);
            Assert.That(intConfig.Items["name0"].Contains("fish"), Is.True);
            Assert.That(intConfig.Items["name1"].Contains("dave1"), Is.True);
            Assert.That(intConfig.Items.Count, Is.EqualTo(2));
        }
コード例 #2
0
ファイル: With_load.cs プロジェクト: perryofpeek/CCSkype
        public void Should_load_single_configration_into_internal_config()
        {
            var config = new Configuration();
            config.Items = new ConfigurationPipeline[1];
            config.Items[0] = new ConfigurationPipeline();
            config.Items[0].name = "name";
            config.Items[0].users = new ConfigurationPipelineUsersUser[2];
            config.Items[0].users[0] = new ConfigurationPipelineUsersUser();
            config.Items[0].users[1] = new ConfigurationPipelineUsersUser();
            config.Items[0].users[0].skypeName = "dave";
            config.Items[0].users[1].skypeName = "fish";

            var intConfig = new InternalConfiguration(config);
            Assert.That(intConfig.Items["name"], Is.Not.Null);
            Assert.That(intConfig.Items["name"].Contains("dave"), Is.True);
            Assert.That(intConfig.Items["name"].Contains("fish"), Is.True);
            Assert.That(intConfig.Items.Count, Is.EqualTo(1));
        }