public void copy_to() { var substitutions = new Substitutions(); substitutions.Set("key", "something"); substitutions.Set("two", "twenty"); var substitutions2 = new Substitutions(); substitutions.CopyTo(substitutions2); substitutions2.ValueFor("key").ShouldEqual("something"); substitutions2.ValueFor("two").ShouldEqual("twenty"); }
public void read_has_set_if_none_semantics() { var substitutions = new Substitutions(); substitutions.Set("key", "something"); substitutions.Set("two", "twenty"); substitutions.WriteTo("fubu.template.config"); var substitutions2 = new Substitutions(); substitutions2.Set("key", "ORIGINAL"); substitutions2.ReadFrom("fubu.template.config"); substitutions2.ValueFor("key").ShouldEqual("ORIGINAL"); substitutions2.ValueFor("two").ShouldEqual("twenty"); }
public void set_if_none_will_write_if_no_previous_value() { var substitutions = new Substitutions(); substitutions.SetIfNone("key", "different"); substitutions.ValueFor("key").ShouldEqual("different"); }
public void set_if_none_will_not_override_if_it_exists() { var substitutions = new Substitutions(); substitutions.Set("key", "something"); substitutions.SetIfNone("key", "different"); substitutions.ValueFor("key").ShouldEqual("something"); }
public void write_and_read() { var substitutions = new Substitutions(); substitutions.Set("key", "something"); substitutions.Set("two", "twenty"); substitutions.WriteTo("fubu.template.config"); var substitutions2 = new Substitutions(); substitutions2.ReadFrom("fubu.template.config"); substitutions2.ValueFor("key").ShouldEqual("something"); substitutions2.ValueFor("two").ShouldEqual("twenty"); }
public void set_value() { var substitutions = new Substitutions(); substitutions.Set("key", "something"); substitutions.Set("two", "twenty"); substitutions.ValueFor("key").ShouldEqual("something"); substitutions.ValueFor("two").ShouldEqual("twenty"); }
public void set_overrides() { var substitutions = new Substitutions(); substitutions.Set("key", "something"); substitutions.Set("key", "different"); substitutions.ValueFor("key").ShouldEqual("different"); }