예제 #1
0
        public void GenericConstructorWithTwoTypes_ExpectedValues()
        {
            // Call
            var viewInfo = new RiskeerViewInfo <int, IView>(() => null);

            // Assert
            Assert.IsInstanceOf <RiskeerViewInfo <int, int, IView> >(viewInfo);
            Assert.IsNotNull(viewInfo.GetSymbol);
            Assert.IsNotNull(viewInfo.GetFontFamily);
        }
예제 #2
0
        public void GetSymbol_GuiNull_ReturnsExpectedValue()
        {
            // Setup
            var viewInfo = new RiskeerViewInfo <int, string, IView>(() => null);

            // Call
            string symbol = viewInfo.GetSymbol();

            // Assert
            Assert.IsNull(symbol);
        }
예제 #3
0
        public void GetFontFamily_GuiNull_ReturnsExpectedValue()
        {
            // Setup
            var viewInfo = new RiskeerViewInfo <int, string, IView>(() => null);

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

            // Assert
            Assert.IsNull(fontFamily);
        }
예제 #4
0
        public void GetSymbol_ActiveStateInfoNull_ReturnsExpectedValue()
        {
            // Setup
            var mockRepository = new MockRepository();
            var gui            = mockRepository.Stub <IGui>();

            mockRepository.ReplayAll();

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

            // Call
            string symbol = viewInfo.GetSymbol();

            // Assert
            Assert.IsNull(symbol);
            mockRepository.VerifyAll();
        }
예제 #5
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();
        }
예제 #6
0
        public void GetSymbol_ActiveStateInfoNotNull_ReturnsExpectedValue()
        {
            // Setup
            const string expectedSymbol = "symbol";

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

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

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

            // Call
            string actualSymbol = viewInfo.GetSymbol();

            // Assert
            Assert.AreEqual(expectedSymbol, actualSymbol);
            mockRepository.VerifyAll();
        }