コード例 #1
0
        public void GetSymbol_GuiNull_ReturnsExpectedValue()
        {
            // Setup
            var viewInfo = new RiskeerViewInfo <int, string, IView>(() => null);

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

            // Assert
            Assert.IsNull(symbol);
        }
コード例 #2
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();
        }
コード例 #3
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();
        }