Exemplo n.º 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);
        }
Exemplo n.º 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));
        }
Exemplo n.º 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));
		}