public void TestInput_Constructor_WhenValidParameters_ShouldSetProperties() { //------------Setup for test-------------------------- //------------Execute Test--------------------------- var input = new ServiceTestInput("someVar", "someValue"); //------------Assert Results------------------------- Assert.AreEqual("someVar", input.Variable); Assert.AreEqual("someValue", input.Value); Assert.IsFalse(input.EmptyIsNull); }
public void TestInput_Value_WhenSetNonEmpty_ShouldInvokeAddRowAction() { //------------Setup for test-------------------------- var input = new ServiceTestInput("someVar", "someValue"); var _wasCalled = false; input.AddNewAction += () => { _wasCalled = true; }; //------------Execute Test--------------------------- input.Value = "val"; //------------Assert Results------------------------- Assert.IsTrue(_wasCalled); }
public void TestInput_Value_WhenSet_ShouldFirePropertyChange() { //------------Setup for test-------------------------- var input = new ServiceTestInput("someVar", "someValue"); var _wasCalled = false; input.PropertyChanged += (sender, args) => { if (args.PropertyName == "Value") { _wasCalled = true; } }; //------------Execute Test--------------------------- input.Value = "val"; //------------Assert Results------------------------- Assert.IsTrue(_wasCalled); }