public void ShouldReturnTheBuilder(ScriptServicesBuilder builder) { var someValue = new SomeOverride(); var returnedBuilder = builder.SetOverride <ISomeOverride, SomeOverride>(someValue); returnedBuilder.ShouldBeSameAs(builder); }
public void ShouldSetTheValueUsingTheKey(ScriptServicesBuilder builder) { var someValue = new SomeOverride(); var key = typeof(ISomeOverride); builder.SetOverride <ISomeOverride, SomeOverride>(someValue); var overrides = builder.Overrides; overrides.ContainsKey(key).ShouldBeTrue(); overrides[key].ShouldBeSameAs(someValue); }
public void ShouldReplaceTheValueWhenKeyAlreadyExists(ScriptServicesBuilder builder) { var key = typeof(ISomeOverride); var firstValue = new SomeOverride(); var secondValue = new SomeOverride(); builder.SetOverride <ISomeOverride, SomeOverride>(firstValue); builder.SetOverride <ISomeOverride, SomeOverride>(secondValue); var overrides = builder.Overrides; overrides[key].ShouldNotBeSameAs(firstValue); overrides[key].ShouldBeSameAs(secondValue); }
public void ShouldReplaceTheValueWhenKeyAlreadyExists(ScriptServicesBuilder builder) { var key = typeof(ISomeOverride); var firstValue = new SomeOverride(); var secondValue = new SomeOverride(); builder.SetOverride<ISomeOverride, SomeOverride>(firstValue); builder.SetOverride<ISomeOverride, SomeOverride>(secondValue); var overrides = builder.Overrides; overrides[key].ShouldNotBeSameAs(firstValue); overrides[key].ShouldBeSameAs(secondValue); }
public void ShouldSetTheValueUsingTheKey(ScriptServicesBuilder builder) { var someValue = new SomeOverride(); var key = typeof(ISomeOverride); builder.SetOverride<ISomeOverride, SomeOverride>(someValue); var overrides = builder.Overrides; overrides.ContainsKey(key).ShouldBeTrue(); overrides[key].ShouldBeSameAs(someValue); }
public void ShouldReturnTheBuilder(ScriptServicesBuilder builder) { var someValue = new SomeOverride(); var returnedBuilder = builder.SetOverride<ISomeOverride, SomeOverride>(someValue); returnedBuilder.ShouldBeSameAs(builder); }