From 869a5fd77340781091a4e118bf487a174e6fdd70 Mon Sep 17 00:00:00 2001 From: David Sparer Date: Wed, 10 Aug 2016 09:06:44 -0600 Subject: [PATCH] Created several simple unit & integration tests for DefaultConnectionInheritance --- .../DefaultConnectionInheritanceTests.cs | 48 +++++++++++++------ 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/mRemoteNGTests/Connection/DefaultConnectionInheritanceTests.cs b/mRemoteNGTests/Connection/DefaultConnectionInheritanceTests.cs index 74023cd70..91d2d45b5 100644 --- a/mRemoteNGTests/Connection/DefaultConnectionInheritanceTests.cs +++ b/mRemoteNGTests/Connection/DefaultConnectionInheritanceTests.cs @@ -1,31 +1,49 @@ - - -using mRemoteNG.Connection; +using mRemoteNG.Connection; using NUnit.Framework; + namespace mRemoteNGTests.Connection { public class DefaultConnectionInheritanceTests { - private readonly DefaultConnectionInheritance _defaultConnectionInheritance; - [SetUp] public void Setup() { - + DefaultConnectionInheritance.Instance.TurnOffInheritanceCompletely(); } - [TearDown] - public void Teardown() - { - - } - - [Test] - public void a() + public void LoadingDefaultInheritanceUpdatesAllProperties() { - + var inheritanceSource = new ConnectionInfoInheritance(new object(), true); + inheritanceSource.TurnOnInheritanceCompletely(); + DefaultConnectionInheritance.Instance.LoadFrom(inheritanceSource); + Assert.That(DefaultConnectionInheritance.Instance.EverythingInherited, Is.True); + } + + [Test] + public void SavingDefaultInheritanceExportsAllProperties() + { + var inheritanceDestination = new ConnectionInfoInheritance(new object(), true); + DefaultConnectionInheritance.Instance.AutomaticResize = true; + DefaultConnectionInheritance.Instance.SaveTo(inheritanceDestination); + Assert.That(inheritanceDestination.AutomaticResize, Is.True); + } + + [Test] + public void NewInheritanceInstancesCreatedWithDefaultInheritanceValues() + { + DefaultConnectionInheritance.Instance.Domain = true; + var inheritanceInstance = new ConnectionInfoInheritance(new object()); + Assert.That(inheritanceInstance.Domain, Is.True); + } + + [Test] + public void NewInheritanceInstancesCreatedWithAllDefaultInheritanceValues() + { + DefaultConnectionInheritance.Instance.TurnOnInheritanceCompletely(); + var inheritanceInstance = new ConnectionInfoInheritance(new object()); + Assert.That(inheritanceInstance.EverythingInherited, Is.True); } } } \ No newline at end of file