From e22faa645300eef47bd3594cd2ca273a25097d2f Mon Sep 17 00:00:00 2001 From: seraphima Date: Fri, 24 Nov 2023 14:35:03 +0100 Subject: [PATCH] changed test initialization --- .../UITests-FancyZonesEditor/CustomLayoutsTests.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/modules/fancyzones/UITests-FancyZonesEditor/CustomLayoutsTests.cs b/src/modules/fancyzones/UITests-FancyZonesEditor/CustomLayoutsTests.cs index 5f063389e0..c340f1d15b 100644 --- a/src/modules/fancyzones/UITests-FancyZonesEditor/CustomLayoutsTests.cs +++ b/src/modules/fancyzones/UITests-FancyZonesEditor/CustomLayoutsTests.cs @@ -130,18 +130,12 @@ namespace Microsoft.FancyZonesEditor.UITests }; _editorParamsIOHelper = new IOTestHelper(editorParameters.File); _editorParamsIOHelper.WriteData(editorParameters.Serialize(parameters)); - - CustomLayouts customLayouts = new CustomLayouts(); - _customLayoutsIOHelper = new IOTestHelper(customLayouts.File); - _customLayoutsIOHelper.WriteData(customLayouts.Serialize(Layouts)); } [ClassCleanup] public static void ClassCleanup() { _editorParamsIOHelper?.RestoreData(); - _customLayoutsIOHelper?.RestoreData(); - _context = null; } @@ -149,12 +143,17 @@ namespace Microsoft.FancyZonesEditor.UITests public void TestInitialize() { _session = new FancyZonesEditorSession(_context!); + + CustomLayouts customLayouts = new CustomLayouts(); + _customLayoutsIOHelper = new IOTestHelper(customLayouts.File); + _customLayoutsIOHelper.WriteData(customLayouts.Serialize(Layouts)); } [TestCleanup] public void TestCleanup() { _session?.Close(_context!); + _customLayoutsIOHelper?.RestoreData(); } [TestMethod]