public void DontAliasAnAlias( ) { var presenter = new TestRemoteDesktopDialogPresenter(); presenter.RecentComputerList.Add( new ComputerName( "1.1.1.1", "MyAlias" ) ); Assert.AreEqual( new ComputerName( "1.1.1.1", "MyAlias" ), presenter.BuildComputerName( "MyAlias", "OtherAlias" ) ); }
public void BuildComputerNameTest( ) { var presenter = new TestRemoteDesktopDialogPresenter(); presenter.RecentComputerList.Add( new ComputerName( "1.1.1.1", "alias" ) ); // Unalias Assert.AreEqual( new ComputerName( "1.1.1.1", "alias" ), presenter.BuildComputerName( "alias", "" ) ); // Retrieve computer and alias given just the computer name. Assert.AreEqual( new ComputerName( "1.1.1.1", "alias" ), presenter.BuildComputerName( "1.1.1.1", "" ) ); // Change alias on an existing item. Assert.AreEqual( new ComputerName( "1.1.1.1", "foobar" ), presenter.BuildComputerName( "1.1.1.1", "foobar" ) ); // Create a new value if not found in the RecentComputerList. Assert.AreEqual( new ComputerName( "2.2.2.2", "OtherAlias" ), presenter.BuildComputerName( "2.2.2.2", "OtherAlias" ) ); }