public void ShouldCheckEqualutyWithConent(string value1, string value2, bool expectedResult) { //Given var firstTableContent = new TableContent("Team Members Table") .AddRow( new [] { new FieldContent("Name", "Eric"), new FieldContent("Role", "Program Manager") }) .AddRow( new [] { new FieldContent("Name", "Bob"), new FieldContent("Role", value1) }); var secondTableContent = new TableContent("Team Members Table") .AddRow( new [] { new FieldContent("Name", "Eric"), new FieldContent("Role", "Program Manager") }) .AddRow( new [] { new FieldContent("Name", "Bob"), new FieldContent("Role", value2) }); //When var result = firstTableContent.Equals(secondTableContent); //Then result.Should().Be(expectedResult); }
public void EqualsTest_CompareWithNull_NotEquals() { var firstTableContent = new TableContent("Team Members Table") .AddRow( new FieldContent("Name", "Bob"), new FieldContent("Role", "Developer")); Assert.IsFalse(firstTableContent.Equals(null)); }
public void EqualsTest_ValuesDifferByRowCount_NotEquals() { var firstTableContent = new TableContent("Team Members Table") .AddRow( new FieldContent("Name", "Bob"), new FieldContent("Role", "Developer")); var secondTableContent = new TableContent("Team Members Table") .AddRow( new FieldContent("Name", "Eric"), new FieldContent("Role", "Program Manager")) .AddRow( new FieldContent("Name", "Bob"), new FieldContent("Role", "Developer")); Assert.IsFalse(firstTableContent.Equals(secondTableContent)); }
public void EqualsTest_ValuesAreEqual_Equals() { var firstTableContent = new TableContent("Team Members Table") .AddRow( new FieldContent("Name", "Eric"), new FieldContent("Role", "Program Manager")) .AddRow( new FieldContent("Name", "Bob"), new FieldContent("Role", "Developer")); var secondTableContent = new TableContent("Team Members Table") .AddRow( new FieldContent("Name", "Eric"), new FieldContent("Role", "Program Manager")) .AddRow( new FieldContent("Name", "Bob"), new FieldContent("Role", "Developer")); Assert.IsTrue(firstTableContent.Equals(secondTableContent)); }