public void PrinterShouldWorkCorrect_WhenEqualsAndGetHashMethodsOverriden() { var foo = new FooWithEquals { Name = "Hello", Next = new FooWithEquals { Name = "Hello" } }; var printer = ObjectPrinter.For <FooWithEquals>(); var actual = printer.PrintToString(foo); actual.Should().Be($"FooWithEquals{Environment.NewLine}" + $"\tName = Hello{Environment.NewLine}" + $"\tNext = FooWithEquals{Environment.NewLine}" + $"\t\tName = Hello{Environment.NewLine}" + $"\t\tNext = null{Environment.NewLine}"); }
protected bool Equals(FooWithEquals other) => Name == other.Name;