From 775499a1ff7739a654b27e8dfee5164519ad754c Mon Sep 17 00:00:00 2001 From: David Sparer Date: Sat, 24 Sep 2016 12:18:37 -0600 Subject: [PATCH] Created more tests for the RemoteDesktopConnectionDeserializer --- ...emoteDesktopConnectionDeserializerTests.cs | 89 ++++++++++++++++++ .../test_remotedesktopconnection.rdp.txt | Bin 2426 -> 2466 bytes 2 files changed, 89 insertions(+) diff --git a/mRemoteNGTests/Config/Serializers/RemoteDesktopConnectionDeserializerTests.cs b/mRemoteNGTests/Config/Serializers/RemoteDesktopConnectionDeserializerTests.cs index 24526a1a..1e77602e 100644 --- a/mRemoteNGTests/Config/Serializers/RemoteDesktopConnectionDeserializerTests.cs +++ b/mRemoteNGTests/Config/Serializers/RemoteDesktopConnectionDeserializerTests.cs @@ -22,6 +22,18 @@ namespace mRemoteNGTests.Config.Serializers private const string ExpectedGatewayHostname = "gatewayhostname.domain.com"; private const int ExpectedPort = 9933; private const ProtocolRDP.RDPColors ExpectedColors = ProtocolRDP.RDPColors.Colors24Bit; + private const bool ExpectedBitmapCaching = false; + private const ProtocolRDP.RDPResolutions ExpectedResolutionMode = ProtocolRDP.RDPResolutions.FitToWindow; + private const bool ExpectedWallpaperDisplay = true; + private const bool ExpectedThemesDisplay = true; + private const bool ExpectedFontSmoothing = true; + private const bool ExpectedDesktopComposition = true; + private const bool ExpectedSmartcardRedirection = true; + private const bool ExpectedDriveRedirection = true; + private const bool ExpectedPortRedirection = true; + private const bool ExpectedPrinterRedirection = true; + private const ProtocolRDP.RDPSounds ExpectedSoundRedirection = ProtocolRDP.RDPSounds.BringToThisComputer; + [OneTimeSetUp] public void OnetimeSetup() @@ -86,6 +98,83 @@ namespace mRemoteNGTests.Config.Serializers Assert.That(connectionInfo.Colors, Is.EqualTo(ExpectedColors)); } + [Test] + public void BitmapCachingImportedCorrectly() + { + var connectionInfo = _connectionTreeModel.RootNodes.First().Children.First(); + Assert.That(connectionInfo.CacheBitmaps, Is.EqualTo(ExpectedBitmapCaching)); + } + + [Test] + public void ResolutionImportedCorrectly() + { + var connectionInfo = _connectionTreeModel.RootNodes.First().Children.First(); + Assert.That(connectionInfo.Resolution, Is.EqualTo(ExpectedResolutionMode)); + } + + [Test] + public void DisplayWallpaperImportedCorrectly() + { + var connectionInfo = _connectionTreeModel.RootNodes.First().Children.First(); + Assert.That(connectionInfo.DisplayWallpaper, Is.EqualTo(ExpectedWallpaperDisplay)); + } + + [Test] + public void DisplayThemesImportedCorrectly() + { + var connectionInfo = _connectionTreeModel.RootNodes.First().Children.First(); + Assert.That(connectionInfo.DisplayThemes, Is.EqualTo(ExpectedThemesDisplay)); + } + + [Test] + public void FontSmoothingImportedCorrectly() + { + var connectionInfo = _connectionTreeModel.RootNodes.First().Children.First(); + Assert.That(connectionInfo.EnableFontSmoothing, Is.EqualTo(ExpectedFontSmoothing)); + } + + [Test] + public void DesktopCompositionImportedCorrectly() + { + var connectionInfo = _connectionTreeModel.RootNodes.First().Children.First(); + Assert.That(connectionInfo.EnableDesktopComposition, Is.EqualTo(ExpectedDesktopComposition)); + } + + [Test] + public void SmartcardRedirectionImportedCorrectly() + { + var connectionInfo = _connectionTreeModel.RootNodes.First().Children.First(); + Assert.That(connectionInfo.RedirectSmartCards, Is.EqualTo(ExpectedSmartcardRedirection)); + } + + [Test] + public void DriveRedirectionImportedCorrectly() + { + var connectionInfo = _connectionTreeModel.RootNodes.First().Children.First(); + Assert.That(connectionInfo.RedirectDiskDrives, Is.EqualTo(ExpectedDriveRedirection)); + } + + [Test] + public void PortRedirectionImportedCorrectly() + { + var connectionInfo = _connectionTreeModel.RootNodes.First().Children.First(); + Assert.That(connectionInfo.RedirectPorts, Is.EqualTo(ExpectedPortRedirection)); + } + + [Test] + public void PrinterRedirectionImportedCorrectly() + { + var connectionInfo = _connectionTreeModel.RootNodes.First().Children.First(); + Assert.That(connectionInfo.RedirectPrinters, Is.EqualTo(ExpectedPrinterRedirection)); + } + + [Test] + public void SoundRedirectionImportedCorrectly() + { + var connectionInfo = _connectionTreeModel.RootNodes.First().Children.First(); + Assert.That(connectionInfo.RedirectSound, Is.EqualTo(ExpectedSoundRedirection)); + } + //[Test] //public void GatewayHostnameImportedCorrectly() //{ diff --git a/mRemoteNGTests/Resources/test_remotedesktopconnection.rdp.txt b/mRemoteNGTests/Resources/test_remotedesktopconnection.rdp.txt index f9e45b69b2bc652ae51738bfe1a225256e5cc3da..f144f9718d281134788b9b0390f8d045fe7d66e6 100644 GIT binary patch delta 69 zcmew*v`Bb@3Zvmh)r(AwhLgWD83RdeX4}b2n8ha7G1q}