Ejemplo n.º 1
0
        public void ReadOnlyField()
        {
            var thing = new ImmutableThing(4, "blah");
            var patch = new ConstructorCompilePatchFactory().Create <ImmutableThing>()
                        .Set(x => x.MyReadOnlyInt, 2)
                        .Set(x => x.MyReadOnlyString, "foo");
            var expected = new ImmutableThing(2, "foo");

            var patched = patch.Apply(thing);

            patched.ShouldBeEquivalentTo(expected);
            thing.MyReadOnlyInt.Should().Be(4); // Original is unchanged
        }
 public ThingThatIsCreatedByDynamicObjectFactoryViaImmutableThing(
     string randomArg,
     [Dependency] ImmutableThing injected
     )
 {
 }