public void Set_Case2() { // arrange var method = IL.NewMethod() .WithParameter(typeof(FooLoo), "foo") .Returns(typeof(void)) .Ldarg("foo") .CallSet<FooLoo>(new { Name = "Elemar" }) .Ret(); var foo = new FooLoo(); // act method.Invoke(foo); // assert foo.Name.Should().Be("Elemar"); }
public void Set_Case2() { // arrange var method = IL.NewMethod() .WithParameter(typeof(FooLoo), "foo") .Returns(typeof(void)) .Ldarg("foo") .CallSet <FooLoo>(new { Name = "Elemar" }) .Ret(); var foo = new FooLoo(); // act method.Invoke(foo); // assert foo.Name.Should().Be("Elemar"); }