Exemple #1
0
        public void WhenBaseOnInitializedWasCalled_ThenDoesNotThrowAnException()
        {
            var layout = new FluxorLayoutThatOptionallyCallsBaseOnInitialized
            {
                CallBaseOnInitialized = true
            };

            layout.Test_OnInitialized();
            layout.Dispose();
        }
Exemple #2
0
        public void WhenBaseOnInitializedWasNotCalled_ThenThrowsNullReferenceException()
        {
            string errorMessage = null;
            var    layout       = new FluxorLayoutThatOptionallyCallsBaseOnInitialized();

            try
            {
                layout.Test_OnInitialized();
                layout.Dispose();
            }
            catch (NullReferenceException e)
            {
                errorMessage = e.Message;
            }
            Assert.Equal("Have you forgotten to call base.OnInitialized() in your component?", errorMessage);
        }