public void MakeSurePartExtensionExistNullChecks()
        {
            var provider = new PartExtensionProvider();

            Assert.Throws <ArgumentNullException>("contentType", () => provider.MakeSurePartExtensionExist(null, null));
            Assert.Throws <ArgumentNullException>("partExtension", () => provider.MakeSurePartExtensionExist(string.Empty, null));
        }
        public void AddContentTypeTwice()
        {
            const string ContentType   = "contentType";
            const string PartExtension = "partExtensions";

            var provider = new PartExtensionProvider();

            Assert.False(provider.ContainsKey(ContentType));
            provider.MakeSurePartExtensionExist(ContentType, PartExtension);
            Assert.True(provider.ContainsKey(ContentType));
            Assert.Equal(PartExtension, provider[ContentType]);

            provider.MakeSurePartExtensionExist(ContentType, PartExtension);
            Assert.True(provider.ContainsKey(ContentType));
            Assert.Equal(PartExtension, provider[ContentType]);
        }
        public void ReplaceContentType()
        {
            const string ContentType    = "contentType";
            const string PartExtension1 = "partExtensions1";
            const string PartExtension2 = "partExtensions2";

            var provider = new PartExtensionProvider();

            Assert.False(provider.ContainsKey(ContentType));
            provider.MakeSurePartExtensionExist(ContentType, PartExtension1);
            Assert.True(provider.ContainsKey(ContentType));
            Assert.Equal(PartExtension1, provider[ContentType]);

            provider.MakeSurePartExtensionExist(ContentType, PartExtension2);
            Assert.True(provider.ContainsKey(ContentType));
            Assert.Equal(PartExtension2, provider[ContentType]);
        }