public void GetItemAs_Convert_ShouldOK() { ScopeContext.Resolve = () => new MockScopeService(true); var scopeContext = ScopeContext.GetScopeContext("001", false); scopeContext.GetItemAs("isFoo", false).ShouldTrue(); scopeContext.GetItemAs("isFooX", false).ShouldFalse(); }
public void GetItem_NotExistKey_ShouldOK() { ScopeContext.Resolve = () => new MockScopeService(true); var scopeContext = ScopeContext.GetScopeContext("001", false); scopeContext.GetItem("NotExist", null).ShouldNull(); scopeContext.GetItem("NotExist", "A").ShouldEqual("A"); }
public void GetItem_ExistKey_ShouldOK() { ScopeContext.Resolve = () => new MockScopeService(true); var scopeContext = ScopeContext.GetScopeContext("001", false); scopeContext.GetItem("foo").ShouldEqual("FOO"); scopeContext.GetItem("FoO").ShouldEqual("FOO"); }
public void SetItem_ExistKey_ShouldReplace() { ScopeContext.Resolve = () => new MockScopeService(true); var scopeContext = ScopeContext.GetScopeContext("001", false); scopeContext.SetItem("foo", "BAR"); scopeContext.GetItem("foo", null).ShouldEqual("BAR"); }
public void GetScopeContext_ReplaceResolve_ShouldOK() { ScopeContext.Resolve = () => new MockScopeService(true); ScopeContext.GetScopeContext("001", false).ShouldNotNull(); //replace repos ScopeContext.Resolve = () => new MockScopeService(false); ScopeContext.GetScopeContext("001", false).ShouldNull(); }
public void GetScopeContext_NotExist_ShouldOK() { ScopeContext.Resolve = () => new MockScopeService(true); ScopeContext.GetScopeContext("NotExist", false).ShouldNull(); }