public override HostType Convert(ConnectionMethodType connectionMethod)
 {
     try {
         return(base.Convert(connectionMethod));
     }
     catch (NotSupportedException) {
         return(HostType.Unknown);
     }
 }
예제 #2
0
 public virtual HostType Convert(ConnectionMethodType connectionMethod)
 {
     if (connectionMethod == ConnectionMethodType.RemoteDesktop || connectionMethod == ConnectionMethodType.RemoteDesktopConsole)
     {
         return(HostType.Windows);
     }
     else if (connectionMethod == ConnectionMethodType.vSphereClient)
     {
         return(HostType.ESXi);
     }
     else if (connectionMethod == ConnectionMethodType.PuttySSH)
     {
         return(HostType.Linux);
     }
     else
     {
         throw new NotSupportedException(String.Format("{0} '{1}' is not supported.", typeof(ConnectionMethodType), connectionMethod));
     }
 }
 public void ConvertThrowsException(ConnectionMethodType connectionMethod)
 {
     Assert.Throws <NotSupportedException>(() => new HostTypeConverter().Convert(connectionMethod));
 }
 public void Convert(ConnectionMethodType connectionMethod, HostType expectedHostType)
 {
     Assert.AreEqual(expectedHostType, new HostTypeConverter().Convert(connectionMethod));
 }
예제 #5
0
 public void ConvertThrowsException(ConnectionMethodType connectionMethod)
 {
     new HostTypeConverter().Convert(connectionMethod);
 }