예제 #1
0
        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);
        }
예제 #2
0
        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));
        }
예제 #3
0
        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));
		}
		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));
		}