public void Test_Equals_Control_WhenOtherNull_ShouldReturnFalse() { //---------------Set up test pack------------------- var adapter = new WinFormsTextBoxAdapter(GenerateStub <TextBox>()); TextBox otherTextBox = null; //---------------Assert Precondition---------------- Assert.IsNull(otherTextBox); //---------------Execute Test ---------------------- var @equals = adapter.Equals(otherTextBox); //---------------Test Result ----------------------- Assert.IsFalse(@equals); }
public void Test_Equals_Control_WhenNotSame_ShouldReturnTrue() { //---------------Set up test pack------------------- var adapter = new WinFormsTextBoxAdapter(GenerateStub <TextBox>()); var otherTextBox = GenerateStub <TextBox>(); //---------------Assert Precondition---------------- Assert.AreNotSame(otherTextBox, adapter.WrappedControl); //---------------Execute Test ---------------------- var @equals = adapter.Equals(otherTextBox); //---------------Test Result ----------------------- Assert.IsFalse(@equals); }