Пример #1
0
        public void ItSetsTheIsAllMemberToFalseWhenTheValueDoesNotStartWithThePrefix()
        {
            var provider = new DefaultValueProvider("AllMemberPrefix");

            var defaultValue = provider.Get("Some Value", "Some Label");

            Assert.IsFalse(defaultValue.IsAllMember);
        }
Пример #2
0
        public void ItSetsTheIsAllMemberToFalseWhenTheValueEndsWithThePrefix()
        {
            const string allMemberPrefix = "AllMemberPrefix";
            var provider = new DefaultValueProvider(allMemberPrefix);

            var defaultValue = provider.Get(string.Format("SomeValue{0}", allMemberPrefix), "Some Label");

            Assert.IsFalse(defaultValue.IsAllMember);
        }
Пример #3
0
        public void ItRemovesThePrefixFromTheValueStartsWithThePrefix()
        {
            const string allMemberPrefix = "AllMemberPrefix";

            const string expected = "SomeValue";

            var provider = new DefaultValueProvider(allMemberPrefix);

            var defaultValue = provider.Get(string.Format("{0}{1}", allMemberPrefix, expected), "Some Label");

            Assert.AreEqual(expected, defaultValue.Value);
        }
Пример #4
0
        public void ItDoesNotRemoveThePrefixFromTheValueEndsWithThePrefix()
        {
            const string allMemberPrefix = "AllMemberPrefix";

            var provider = new DefaultValueProvider(allMemberPrefix);

            var expected = string.Format("SomeValue{0}", allMemberPrefix);

            var defaultValue = provider.Get(expected, "Some Label");

            Assert.AreEqual(expected, defaultValue.Value);
        }
Пример #5
0
        public void ItUsesTheLabelForTheLabel()
        {
            const string label = "Some Label";

            var provider = new DefaultValueProvider("AllMemberPrefix");

            var defaultValue = provider.Get("Some Value", label);

            Assert.AreEqual(label, defaultValue.Label);
        }
Пример #6
0
        public void ItSetsTheIsAllMemberToTrueWhenTheValueDoesStartWithThePrefix()
        {
            const string allMemberPrefix = "AllMemberPrefix";
            var provider = new DefaultValueProvider(allMemberPrefix);

            var defaultValue = provider.Get(string.Format("{0}SomeValue", allMemberPrefix), "Some Label");

            Assert.IsTrue(defaultValue.IsAllMember);
        }
Пример #7
0
        public void ItUsesTheValueForTheValue()
        {
            const string value = "Some Value";

            var provider = new DefaultValueProvider("AllMemberPrefix");

            var defaultValue = provider.Get(value, "Some Label");

            Assert.AreEqual(value, defaultValue.Value);
        }