public void InjectionContext_SetValue_Dont_Override() { var context = new Grace.DependencyInjection.Impl.InjectionContext(null); context.SetExtraData(5, "Hello"); Assert.Equal("Hello", context.GetExtraData(5)); context.SetExtraData(5, "World", replaceIfExists: false); Assert.Equal("Hello", context.GetExtraData(5)); }
public void InjectionContext_GetValueByType() { var context = new Grace.DependencyInjection.Impl.InjectionContext(null); context.SetExtraData(5, "Hello"); Assert.Equal("Hello", context.GetValueByType(typeof(string))); }
public void InjectionContext_Value() { var context = new Grace.DependencyInjection.Impl.InjectionContext(null); context.SetExtraData("Hello", "World"); var keys = context.Values.ToArray(); Assert.Equal(1, keys.Length); Assert.Equal("World", keys[0]); }