public void CanAssertDifferentTypesWithSameProperties_ExplicitlyNamePropertiesToCompare() { var d = DateTime.Now.AddDays(-1); var dumpConfig = new IObjectDumperPart[] { new OrderByPropertyNameTransform(t => t?.FullName?.Contains("Anonymous") == true), new PropertyNameFilter("Name", "Weight", "Date") }; var a = new { Name = "Test", Weight = 2, Date = d, Skip = "A" }.Dump(dumpConfig); var b = new { Name = "Test", Date = d, Weight = 2, Skip = "B" }.Dump(dumpConfig); a.Should().BeEquivalentTo(b); }
public void CanAssertMultiplePropertiesWithFluentAssertions_ExplicitlyNamePropertiesToCompare() { var d = DateTime.Now.AddDays(-1); var dumpConfig = new IObjectDumperPart[] { new PropertyNameFilter("Name", "Weight", "Date") }; var a = new { Name = "Test", Weight = 2, Date = d, Skip = "A" }.Dump(dumpConfig); var b = new { Name = "Test", Weight = 2, Date = d, Skip = "B" }.Dump(dumpConfig); a.Should().BeEquivalentTo(b); }
public void CanAssertDifferentTypesWithSameProperties() { var d = DateTime.Now.AddDays(-1); var dumpConfig = new IObjectDumperPart[] { new OrderByPropertyNameTransform(t => t?.FullName?.Contains("Anonymous") == true) }; var a = new { Name = "Test", Weight = 2, Date = d }.Dump(dumpConfig); var b = new { Name = "Test", Date = d, Weight = 2 }.Dump(dumpConfig); a.Should().BeEquivalentTo(b); }
public void CanAssertMultiplePropertiesWithFluentAssertions_SkipOneProperty() { var d = DateTime.Now.AddDays(-1); var dumpConfig = new IObjectDumperPart[] { new PropertyNameExclusionFilter("Skip") }; var a = new { Name = "Test", Weight = 2, Date = d, Skip = "A" }.Dump(dumpConfig); var b = new { Name = "Test", Weight = 2, Date = d, Skip = "B" }.Dump(dumpConfig); a.Should().BeEquivalentTo(b); }