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); }
public void GetSymbol_GuiNull_ReturnsExpectedValue() { // Setup var viewInfo = new RiskeerViewInfo <int, string, IView>(() => null); // Call string symbol = viewInfo.GetSymbol(); // Assert Assert.IsNull(symbol); }
public void GetFontFamily_GuiNull_ReturnsExpectedValue() { // Setup var viewInfo = new RiskeerViewInfo <int, string, IView>(() => null); // Call FontFamily fontFamily = viewInfo.GetFontFamily(); // Assert Assert.IsNull(fontFamily); }
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(); }
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(); }
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(); }