Beispiel #1
0
        public void GetFontFamily_GuiNull_ReturnsExpectedValue()
        {
            // Setup
            var viewInfo = new RiskeerViewInfo <int, string, IView>(() => null);

            // Call
            FontFamily fontFamily = viewInfo.GetFontFamily();

            // Assert
            Assert.IsNull(fontFamily);
        }
Beispiel #2
0
        public void GetFontFamily_ActiveStateInfoNull_ReturnsExpectedValue()
        {
            // Setup
            var mockRepository = new MockRepository();
            var gui            = mockRepository.Stub <IGui>();

            mockRepository.ReplayAll();

            var viewInfo = new RiskeerViewInfo <int, string, IView>(() => gui);

            // Call
            FontFamily fontFamily = viewInfo.GetFontFamily();

            // Assert
            Assert.IsNull(fontFamily);
            mockRepository.VerifyAll();
        }
Beispiel #3
0
        public void GetFontFamily_ActiveStateInfoNotNull_ReturnsExpectedValue()
        {
            // Setup
            var expectedFontFamily = new FontFamily();

            var mockRepository = new MockRepository();
            var gui            = mockRepository.Stub <IGui>();

            gui.Stub(g => g.ActiveStateInfo).Return(new StateInfo(string.Empty, string.Empty, expectedFontFamily, p => p));
            mockRepository.ReplayAll();

            var viewInfo = new RiskeerViewInfo <int, string, IView>(() => gui);

            // Call
            FontFamily actualFontFamily = viewInfo.GetFontFamily();

            // Assert
            Assert.AreSame(expectedFontFamily, actualFontFamily);
            mockRepository.VerifyAll();
        }