public void Initialize_RegisteredInstances_ShouldSucceed() { ContextTests instanceOne = new ContextTests(); ContextTests instanceTwo = new ContextTests(); Context.Register(this); Context.Register(instanceOne); Context.Register(instanceTwo); Context.Initialize(); Context.Invoke(); Assert.True(ContextTests.DefaultFieldsEqual(this)); Assert.True(ContextTests.DefaultFieldsEqual(instanceOne)); Assert.True(ContextTests.DefaultFieldsEqual(instanceTwo)); }
public void Initialize_SpecificInstance_ShouldSucceed() { Context.Initialize(this); Assert.True(ContextTests.DefaultFieldsEqual(this)); }
// HACK: Because Context is static, we reset the instance before each test. public ContextTests() { ContextTests.PerformReset(); }
private static bool DefaultFieldsEqual(ContextTests instance) { return(StrKnowns.Default.Equals(instance.StrAttribute) && DblKnowns.Default.Equals(instance.DblAttribute.ToString()) && IntKnowns.Default.Equals(instance.IntAttribute.ToString())); }