Beispiel #1
0
        public void WhenBaseOnInitializedWasCalled_ThenDoesNotThrowAnException()
        {
            var component = new FluxorComponentThatOptionallyCallsBaseOnInitialized
            {
                CallBaseOnInitialized = true
            };

            component.Test_OnInitialized();
            component.Dispose();
        }
Beispiel #2
0
        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);
        }