public void Catching_argument_and_checking_manually_with_fluent_assertions() { // Arrange PlainValueArgument arg = default; _fooService .DoStuff(Arg.Do <PlainValueArgument>(x => arg = x)); // Act _component.DoStuff(); // Assert _fooService.Received() .DoStuff(Arg.Any <PlainValueArgument>()); // passes arg.Should() .BeEquivalentTo(new PlainValueArgument(3, 7)); /* * // fails * arg.Should() * .BeEquivalentTo(new PlainValueArgument(100, 200)); * // */ }
public void Catching_argument_and_checking_manually_with_nfluent() { // Arrange PlainValueArgument arg = default; _fooService .DoStuff(Arg.Do <PlainValueArgument>(x => arg = x)); // Act _component.DoStuff(); // Assert _fooService.Received() .DoStuff(Arg.Any <PlainValueArgument>()); // passes Check.That(arg).HasFieldsWithSameValues( new PlainValueArgument(3, 7)); /* * // fails * Check.That(arg).HasFieldsWithSameValues( * new PlainValueArgument(100, 200)); * // */ }