public void PartnersCanBeChanged() { var ctx = new StandardContext(); ctx.Add("Hotrod"); ctx.Replace("Douchebag"); ctx.Get<string>().ShouldBeEqualTo("Douchebag"); }
public void PrimitivePolymorphismIsThere() { var ctx = new StandardContext(); var reader = new BinaryReader(new MemoryStream()); ctx.Add<IDisposable>(reader); ctx.Get<IDisposable>().ShouldBeTheSameAs(reader); }
public void ContextIsCloneable() { StandardContext ctx = new StandardContext(); ctx.Add("string"); var ctx2 = ctx.CloneContext(); ctx2.Get<string>().ShouldBeTheSameAs(ctx.Get<string>()); }
public void ContextAcceptsOneOfAKind() { var ctx = new StandardContext(); ctx.Add("Hello"); ctx.Get<string>().ShouldBeEqualTo("Hello"); }
public void ContextCloneCanBeModifiedWithoutAffectingTheOriginal() { StandardContext ctx = new StandardContext(); ctx.Add("horse"); var ctx2 = ctx.CloneContext(); ctx2.Replace("dog"); ctx2.Add(new StringBuilder()); ctx.Get<string>().ShouldBeTheSameAs("horse"); ctx.Get<StringBuilder>().ShouldBeNull(); }