Browse Source

Fixed tests

flabbet 3 years ago
parent
commit
7a52abe153

+ 2 - 2
PixiEditorTests/ModelsTests/ControllersTests/ShortcutControllerTests.cs

@@ -42,7 +42,7 @@ namespace PixiEditorTests.ModelsTests.ControllersTests
             RelayCommand shortcutCommand = new RelayCommand(arg => { result = (int)arg; });
             RelayCommand shortcutCommand = new RelayCommand(arg => { result = (int)arg; });
 
 
             ShortcutController controller = GenerateStandardShortcutController(Key.A, ModifierKeys.None, shortcutCommand);
             ShortcutController controller = GenerateStandardShortcutController(Key.A, ModifierKeys.None, shortcutCommand);
-            ShortcutController.BlockShortcutExecution = true;
+            ShortcutController.BlockShortcutExection("Test");
 
 
             controller.KeyPressed(Key.A, ModifierKeys.None);
             controller.KeyPressed(Key.A, ModifierKeys.None);
             Assert.Equal(-1, result);
             Assert.Equal(-1, result);
@@ -75,7 +75,7 @@ namespace PixiEditorTests.ModelsTests.ControllersTests
         {
         {
             ShortcutController controller = new ShortcutController();
             ShortcutController controller = new ShortcutController();
             controller.ShortcutGroups.Add(new ShortcutGroup(string.Empty, new Shortcut(shortcutKey, shortcutCommand, 0, modifiers)));
             controller.ShortcutGroups.Add(new ShortcutGroup(string.Empty, new Shortcut(shortcutKey, shortcutCommand, 0, modifiers)));
-            ShortcutController.BlockShortcutExecution = false;
+            ShortcutController.UnblockShortcutExecutionAll();
             return controller;
             return controller;
         }
         }
     }
     }

+ 4 - 4
PixiEditorTests/ModelsTests/DataHoldersTests/RecentlyOpenedDocumentTests.cs

@@ -11,7 +11,7 @@ namespace PixiEditorTests.ModelsTests.DataHoldersTests
         [Fact]
         [Fact]
         public void TestThatForBigPixiFilesPreviewImageIsResizedToMaxSize()
         public void TestThatForBigPixiFilesPreviewImageIsResizedToMaxSize()
         {
         {
-            string bigFilePath = $@"{Environment.CurrentDirectory}\..\..\..\ModelsTests\IO\BigPixiFile.pixi";
+            string bigFilePath = $@"{Environment.CurrentDirectory}\..\..\..\..\ModelsTests\IO\BigPixiFile.pixi";
             RecentlyOpenedDocument recentlyOpenedDocument = new RecentlyOpenedDocument(bigFilePath);
             RecentlyOpenedDocument recentlyOpenedDocument = new RecentlyOpenedDocument(bigFilePath);
 
 
             var bigPixiFilePreviewImage = recentlyOpenedDocument.PreviewBitmap;
             var bigPixiFilePreviewImage = recentlyOpenedDocument.PreviewBitmap;
@@ -29,7 +29,7 @@ namespace PixiEditorTests.ModelsTests.DataHoldersTests
         [Fact]
         [Fact]
         public void TestThatForSmallEnoughPixiFilesPreviewImageIsLoaded()
         public void TestThatForSmallEnoughPixiFilesPreviewImageIsLoaded()
         {
         {
-            string smallEnoughFilePath = $@"{Environment.CurrentDirectory}\..\..\..\ModelsTests\IO\SmallEnoughPixiFile.pixi";
+            string smallEnoughFilePath = $@"{Environment.CurrentDirectory}\..\..\..\..\ModelsTests\IO\SmallEnoughPixiFile.pixi";
             RecentlyOpenedDocument recentlyOpenedDocument = new RecentlyOpenedDocument(smallEnoughFilePath);
             RecentlyOpenedDocument recentlyOpenedDocument = new RecentlyOpenedDocument(smallEnoughFilePath);
 
 
             var smallEnoughFilePreviewImage = recentlyOpenedDocument.PreviewBitmap;
             var smallEnoughFilePreviewImage = recentlyOpenedDocument.PreviewBitmap;
@@ -43,7 +43,7 @@ namespace PixiEditorTests.ModelsTests.DataHoldersTests
         [InlineData("jpeg")]
         [InlineData("jpeg")]
         public void TestThatForBigImageFilesPreviewImageIsResizedToMaxSize(string imageFormat)
         public void TestThatForBigImageFilesPreviewImageIsResizedToMaxSize(string imageFormat)
         {
         {
-            string bigImageFilePath = $@"{Environment.CurrentDirectory}\..\..\..\ModelsTests\IO\BigImage.{imageFormat}";
+            string bigImageFilePath = $@"{Environment.CurrentDirectory}\..\..\..\..\ModelsTests\IO\BigImage.{imageFormat}";
             RecentlyOpenedDocument recentlyOpenedDocument = new RecentlyOpenedDocument(bigImageFilePath);
             RecentlyOpenedDocument recentlyOpenedDocument = new RecentlyOpenedDocument(bigImageFilePath);
 
 
             var bigImagePreviewImage = recentlyOpenedDocument.PreviewBitmap;
             var bigImagePreviewImage = recentlyOpenedDocument.PreviewBitmap;
@@ -61,7 +61,7 @@ namespace PixiEditorTests.ModelsTests.DataHoldersTests
         [InlineData("jpeg")]
         [InlineData("jpeg")]
         public void TestThatForSmallEnoughImageFilesPreviewImageIsLoaded(string imageFormat)
         public void TestThatForSmallEnoughImageFilesPreviewImageIsLoaded(string imageFormat)
         {
         {
-            string smallEnoughImageFilePath = $@"{Environment.CurrentDirectory}\..\..\..\ModelsTests\IO\SmallEnoughImage.{imageFormat}";
+            string smallEnoughImageFilePath = $@"{Environment.CurrentDirectory}\..\..\..\..\ModelsTests\IO\SmallEnoughImage.{imageFormat}";
             RecentlyOpenedDocument recentlyOpenedDocument = new RecentlyOpenedDocument(smallEnoughImageFilePath);
             RecentlyOpenedDocument recentlyOpenedDocument = new RecentlyOpenedDocument(smallEnoughImageFilePath);
 
 
             var smallEnoughImagePreviewImage = recentlyOpenedDocument.PreviewBitmap;
             var smallEnoughImagePreviewImage = recentlyOpenedDocument.PreviewBitmap;

+ 2 - 2
PixiEditorTests/ModelsTests/IO/ImporterTests.cs

@@ -16,8 +16,8 @@ namespace PixiEditorTests.ModelsTests.IO
         // I am not testing ImportDocument, because it's just a wrapper for BinarySerialization which is tested.
         // I am not testing ImportDocument, because it's just a wrapper for BinarySerialization which is tested.
         public ImporterTests()
         public ImporterTests()
         {
         {
-            testImagePath = $"{Environment.CurrentDirectory}\\..\\..\\..\\ModelsTests\\IO\\TestImage.png";
-            testCorruptedPixiImagePath = $"{Environment.CurrentDirectory}\\..\\..\\..\\ModelsTests\\IO\\CorruptedPixiFile.pixi";
+            testImagePath = $"{Environment.CurrentDirectory}\\..\\..\\..\\..\\ModelsTests\\IO\\TestImage.png";
+            testCorruptedPixiImagePath = $"{Environment.CurrentDirectory}\\..\\..\\..\\..\\ModelsTests\\IO\\CorruptedPixiFile.pixi";
         }
         }
 
 
         [Theory]
         [Theory]