public void ShouldBeSetTooIfStateIsNotOpened(Services.PortState portState) { var communicationService = new TestHartCommunicationService { PortState = portState }; var viewModel = new StatusBarViewModel(communicationService); viewModel.PortName.Should().Be("COM1"); }
public void ShouldReturnDefaultValueOfService(Services.PortState expectedPortState) { var communicationMock = new Mock <IHartCommunicationService>(); communicationMock.SetupGet(item => item.PortState).Returns(expectedPortState); var viewModel = new StatusBarViewModel(communicationMock.Object); viewModel.PortState.Should().Be(expectedPortState); }
public void CanExecuteShouldBeFalseIfPortStateIsNotClosed(Services.PortState portState) { var uiVisualizerService = new Cinch.TestUIVisualizerService(); var viewModel = new RibbonViewModel(GetTestApplicationServices(), new CommonServices { UiVisualizerService = uiVisualizerService }) { PortState = portState }; viewModel.ConfigurateConnectionCommand.CanExecute(null).Should().BeFalse(); }
public void ShouldCanExecuteIfStateIsNotChanging(Services.PortState portState) { var messageBoxService = new TestMessageBoxService(); var hartCommunicationService = new TestHartCommunicationService { PortState = portState }; var viewModel = new RibbonViewModel(new ApplicationServices { HartCommunicationService = hartCommunicationService }, new CommonServices { MessageBoxService = messageBoxService }); viewModel.ConnectionCommand.CanExecute(null).Should().BeTrue(); }