public void GetAndRemoveNonEmptyStringAttribute_WithMissingAttributeAndNotRequired()
        {
            StubExtendedProvider provider = new StubExtendedProvider("Provider", new NameValueCollection());
            NameValueCollection  config   = new NameValueCollection();

            Assert.That(provider.GetAndRemoveNonEmptyStringAttribute(config, "Name", "Provider", false), Is.Null);
        }
        public void GetAndRemoveNonEmptyStringAttribute_WithMissingAttributeAndRequired()
        {
            StubExtendedProvider provider = new StubExtendedProvider("Provider", new NameValueCollection());
            NameValueCollection  config   = new NameValueCollection();

            provider.GetAndRemoveNonEmptyStringAttribute(config, "Name", "Provider", true);
        }
        public void GetAndRemoveNonEmptyStringAttribute_WithEmptyAttributeAndNotRequired()
        {
            StubExtendedProvider provider = new StubExtendedProvider("Provider", new NameValueCollection());
            NameValueCollection  config   = new NameValueCollection();

            config.Add("Name", string.Empty);

            provider.GetAndRemoveNonEmptyStringAttribute(config, "Name", "Provider", false);
        }
        public void Initialize()
        {
            NameValueCollection config = new NameValueCollection();

            config.Add("description", "The Description");

            ExtendedProviderBase provider = new StubExtendedProvider("Provider", config);

            Assert.That(provider.Name, Is.EqualTo("Provider"));
            Assert.That(provider.Description, Is.EqualTo("The Description"));
        }
        public void GetAndRemoveNonEmptyStringAttribute()
        {
            StubExtendedProvider provider = new StubExtendedProvider("Provider", new NameValueCollection());
            NameValueCollection  config   = new NameValueCollection();

            config.Add("Name", "Value");
            config.Add("Other", "OtherValue");

            Assert.That(provider.GetAndRemoveNonEmptyStringAttribute(config, "Name", "Provider", true), Is.EqualTo("Value"));
            Assert.That(config.Get("Other"), Is.EqualTo("OtherValue"));
            Assert.That(config["Name"], Is.Null);
        }
        public void GetAndRemoveNonEmptyStringAttribute_WithEmptyAttributeAndRequired()
        {
            StubExtendedProvider provider = new StubExtendedProvider("Provider", new NameValueCollection());
            NameValueCollection  config   = new NameValueCollection();

            config.Add("Name", string.Empty);

            try
            {
                provider.GetAndRemoveNonEmptyStringAttribute(config, "Name", "Provider", true);
            }
            catch
            {
                Assert.That(config.AllKeys.Length, Is.EqualTo(1));
                throw;
            }
        }