コード例 #1
0
        public void Categories_AddNonNullItem_Success()
        {
            Collection <CategoriesDocument> collection = new ResourceCollectionInfo().Categories;

            collection.Add(new InlineCategoriesDocument());
            Assert.Equal(1, collection.Count);
        }
コード例 #2
0
        public void Accepts_AddNonNullItem_Success()
        {
            Collection <string> collection = new ResourceCollectionInfo().Accepts;

            collection.Add("value");
            Assert.Equal(1, collection.Count);
        }
コード例 #3
0
        public void Categories_SetNullItem_ThrowsArgumentNullException()
        {
            Collection <CategoriesDocument> collection = new ResourceCollectionInfo().Categories;

            collection.Add(new InlineCategoriesDocument());

            AssertExtensions.Throws <ArgumentNullException>("item", () => collection[0] = null);
        }
コード例 #4
0
        public void Accepts_SetNullItem_ThrowsArgumentNullException()
        {
            Collection <string> collection = new ResourceCollectionInfo().Accepts;

            collection.Add("value");

            AssertExtensions.Throws <ArgumentNullException>("item", () => collection[0] = null);
        }
コード例 #5
0
        public void Accepts_SetNonNullItem_GetReturnsExpected()
        {
            Collection <string> collection = new ResourceCollectionInfo().Accepts;

            collection.Add("value");

            collection[0] = "newValue";
            Assert.Equal("newValue", collection[0]);
        }
コード例 #6
0
        public void Categories_SetNonNullItem_GetReturnsExpected()
        {
            Collection <CategoriesDocument> collection = new ResourceCollectionInfo().Categories;

            collection.Add(new InlineCategoriesDocument());

            var newValue = new ReferencedCategoriesDocument();

            collection[0] = newValue;
            Assert.Same(newValue, collection[0]);
        }