Exemplo n.º 1
0
        public void alter_is_isolated()
        {
            theParent.Replace(new FakeSettings());

            theSettings.Alter <FakeSettings>(x => x.Hometown = "Austin");

            theParent.Get <FakeSettings>().Hometown.ShouldNotEqual("Austin");
            theSettings.Get <FakeSettings>().Hometown.ShouldEqual("Austin");
        }
Exemplo n.º 2
0
        public void can_alter_the_settings_without_replacing_it()
        {
            var original = theSettings.Get <FakeSettings>();

            theSettings.Alter <FakeSettings>(x => x.Name = "Max");

            theSettings.Get <FakeSettings>().ShouldBeTheSameAs(original);
            theSettings.Get <FakeSettings>().Name.ShouldEqual("Max");
        }
Exemplo n.º 3
0
        public void can_alter_the_settings_without_replacing_it()
        {
            var original = theSettings.Get <FakeSettings>();

            theSettings.Alter <FakeSettings>(x =>
            {
                Thread.Sleep(500);
                x.Name = "Max";
            });

            theSettings.Get <FakeSettings>().ShouldBeTheSameAs(original);
            theSettings.Get <FakeSettings>().Name.ShouldBe("Max");
        }