示例#1
0
        public void When_merging_two_definition_caches_it_will_not_add_duplicate_commands()
        {
            var type  = DefinitionCacheItemType.Script;
            var time  = DateTime.Now;
            var cache = new DefinitionCache();

            cache
            .Add(type, "", time, false, true, "cmd1", "")
            .Append(type, "", time, false, true, "cmd2", "")
            .Append(type, "", time, false, true, "cmd3", "")
            .Append(type, "", time, false, false, "-g", "");
            var another = new DefinitionCache();

            another
            .Add(type, "", time, false, true, "cmd1", "")
            .Append(type, "", time, false, true, "cmdAnother", "");
            cache.Merge(new string[]   {
            }, another);
            Assert.That(cache.Definitions.Length, Is.EqualTo(1));
        }
示例#2
0
        public void Can_merge_two_definition_caches()
        {
            var type  = DefinitionCacheItemType.Script;
            var time  = DateTime.Now;
            var cache = new DefinitionCache();

            cache
            .Add(type, "", time, false, true, "cmd1", "")
            .Append(type, "", time, false, true, "cmd2", "")
            .Append(type, "", time, false, true, "cmd3", "")
            .Append(type, "", time, false, false, "-g", "");
            var another = new DefinitionCache();

            another
            .Add(type, "", time, false, true, "cmdAnother", "")
            .Append(type, "", time, false, true, "cmdAnother2", "");
            cache.Merge(new string[]   {
            }, another);
            Assert.That(cache.Definitions.Length, Is.EqualTo(2));
        }