예제 #1
0
        public void Constructor_VariousCollections_Success(string[] expected, ICollection items)
        {
            var collection = new ServiceNameCollection(items);

            Assert.Equal(expected, collection.Cast <string>());
            Assert.Equal(expected.Length, collection.Count);
        }
예제 #2
0
        public void Merge_VariousEnumerables_Success(string[] expected, IEnumerable serviceNames)
        {
            var collection = new ServiceNameCollection(new[] { "first", "second" });
            ServiceNameCollection merged = collection.Merge(serviceNames);

            Assert.Equal(expected, merged.Cast <string>());
            Assert.Equal(expected.Length, merged.Count);
        }
예제 #3
0
        public void Merge_NonDuplicateString_Succeeds()
        {
            string[] expected   = new[] { "first", "second", "third" };
            var      collection = new ServiceNameCollection(new[] { "first", "second" });

            ServiceNameCollection merged = collection.Merge("third");

            Assert.Equal(expected, merged.Cast <string>());
        }
예제 #4
0
        public void Merge_DuplicateString_DuplicateFiltered(string duplicate)
        {
            string[] expected   = new[] { "first", "second" };
            var      collection = new ServiceNameCollection(new[] { "first", "second" });

            ServiceNameCollection merged = collection.Merge(duplicate);

            Assert.Equal(expected, merged.Cast <string>());
        }
 public void Constructor_VariousCollections_Success(string[] expected, ICollection items)
 {
     var collection = new ServiceNameCollection(items);
     Assert.Equal(expected, collection.Cast<string>());
     Assert.Equal(expected.Length, collection.Count);
 }