public void WhenBaseOnInitializedWasCalled_ThenDoesNotThrowAnException() { var component = new FluxorComponentThatOptionallyCallsBaseOnInitialized { CallBaseOnInitialized = true }; component.Test_OnInitialized(); component.Dispose(); }
public void WhenBaseOnInitializedWasNotCalled_ThenThrowsNullReferenceException() { string errorMessage = null; var component = new FluxorComponentThatOptionallyCallsBaseOnInitialized(); try { component.Test_OnInitialized(); component.Dispose(); } catch (NullReferenceException e) { errorMessage = e.Message; } Assert.Equal("Have you forgotten to call base.OnInitialized() in your component?", errorMessage); }