public Convert ( object value, |
||
value | object | The value produced by the binding source. |
targetType | The type of the binding target property. | |
parameter | object | The converter parameter to use. |
culture | The culture to use in the converter. | |
return | object |
public void DeployViewConnectedToVisiblityConverter_Convert_EnvironmentModelIsNull_VisibilityIsCollapsed() { //Arrange var converter = new DeployViewConnectedToVisiblityConverter(); //Act var actual = (Visibility)converter.Convert(null, typeof(bool), null, null); //Assert Assert.AreEqual(Visibility.Collapsed, actual); }
public void DeployViewConnectedToVisiblityConverter_Convert_IsConnectedIsTrue_VisibilityIsCollapsed() { //Arrange var converter = new DeployViewConnectedToVisiblityConverter(); Mock<IEnvironmentConnection> mockEnvironmentConnection = new Mock<IEnvironmentConnection>(); mockEnvironmentConnection.Setup(m => m.ServerEvents).Returns(new Mock<IEventPublisher>().Object); mockEnvironmentConnection.Setup(m => m.IsConnected).Returns(true); IEnvironmentModel environmentModel = new EnvironmentModel(Guid.NewGuid(), mockEnvironmentConnection.Object, new Mock<IStudioResourceRepository>().Object); //Act var actual = (Visibility)converter.Convert(environmentModel, typeof(bool), null, null); //Assert Assert.AreEqual(Visibility.Visible, actual); }