Ejemplo n.º 1
0
        public void ListItemSetter_Execute_NullParameter_ThrowsException()
        {
            var listItemSetter = new ListItemSetter();
            dynamic config = new DynamicConfiguration();

            listItemSetter.Execute("SomeMethodCall", config, null);
        }
Ejemplo n.º 2
0
        public void ListItemSetter_Execute_EmptyArray_ThrowsException()
        {
            var listItemSetter = new ListItemSetter();
            dynamic config = new DynamicConfiguration();

            listItemSetter.Execute("SomeMethodCall", config);
        }
Ejemplo n.º 3
0
        public void ListItemSetter_Execute_ValidMethodName_CreatesConfigProperty()
        {
            var listItemSetter = new ListItemSetter();
            dynamic config = new DynamicConfiguration();

            listItemSetter.Execute("HasNamesListItem", config, "SomeValue");

            Assert.IsNotNull(config.Names);
        }
Ejemplo n.º 4
0
        public void ListItemSetter_Execute_SingleValidMethodName_CreatesListConfigPropertyWithCorrect()
        {
            var listItemSetter = new ListItemSetter();
            dynamic config = new DynamicConfiguration();

            listItemSetter.Execute("HasNamesListItem", config, "SomeValue");

            Assert.IsTrue(config.Names.Count == 1);
            Assert.AreEqual(config.Names[0], "SomeValue");
        }
Ejemplo n.º 5
0
        public void ListItemSetter_Execute_MultipleValidMethodName_CreatesListConfigPropertyWithMultipleItems()
        {
            var listItemSetter = new ListItemSetter();
            dynamic config = new DynamicConfiguration();

            listItemSetter.Execute("HasNamesListItem", config, "SomeValue1");
            listItemSetter.Execute("HasNamesListItem", config, "SomeValue2");
            listItemSetter.Execute("HasNamesListItem", config, "SomeValue3");

            Assert.IsTrue(config.Names.Count == 3);

            Assert.AreEqual(config.Names[0], "SomeValue1");

            Assert.AreEqual(config.Names[1], "SomeValue2");

            Assert.AreEqual(config.Names[2], "SomeValue3");
        }
Ejemplo n.º 6
0
 public void ListItemSetter_IsMatch_NullPropertyName_ReturnsFalse()
 {
     var settter = new ListItemSetter();
     Assert.IsFalse(settter.IsMatch("HasListItem"));
 }
Ejemplo n.º 7
0
        public void ListItemSetter_Execute_ValidMethodName_CreatesListConfigProperty()
        {
            var listItemSetter = new ListItemSetter();
            dynamic config = new DynamicConfiguration();

            listItemSetter.Execute("HasNamesListItem", config, "SomeValue");

            Assert.IsTrue(config.Names.GetType().Name.StartsWith("List"));
        }
Ejemplo n.º 8
0
 public void ListItemSetter_IsMatch_ValidSuffixInvalidPrefix_ReturnsFalse()
 {
     var settter = new ListItemSetter();
     Assert.IsFalse(settter.IsMatch("SomePropertyListItem"));
 }
Ejemplo n.º 9
0
 public void ListItemSetter_IsMatch_ValidMethodName_ReturnsTrue()
 {
     var settter = new ListItemSetter();
     Assert.IsTrue(settter.IsMatch("HasSomePropertyListItem"));
 }
Ejemplo n.º 10
0
 public void ListItemSetter_IsMatch_RandomMethodName_ReturnsFalse()
 {
     var settter = new ListItemSetter();
     Assert.IsFalse(settter.IsMatch("SomeRandomName"));
 }