mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
Assert was switched in these instances, so I changed it to the "expected, actual" (#7142)
Co-authored-by: p-storm <paul.de.man@gmail.com>
This commit is contained in:
@@ -42,8 +42,8 @@ namespace Microsoft.Plugin.Program.UnitTests.Storage
|
||||
string pathFromQueue = EventHandler.GetAppPathFromQueue(eventHandlingQueue, dequeueDelay);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(pathFromQueue, appPath);
|
||||
Assert.AreEqual(eventHandlingQueue.Count, 0);
|
||||
Assert.AreEqual(appPath, pathFromQueue);
|
||||
Assert.AreEqual(0, eventHandlingQueue.Count);
|
||||
}
|
||||
|
||||
[TestCase(5)]
|
||||
@@ -68,8 +68,8 @@ namespace Microsoft.Plugin.Program.UnitTests.Storage
|
||||
string pathFromQueue = EventHandler.GetAppPathFromQueue(eventHandlingQueue, dequeueDelay);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(pathFromQueue, firstAppPath);
|
||||
Assert.AreEqual(eventHandlingQueue.Count, itemCount);
|
||||
Assert.AreEqual(firstAppPath, pathFromQueue);
|
||||
Assert.AreEqual(itemCount, eventHandlingQueue.Count);
|
||||
}
|
||||
|
||||
[TestCase(5)]
|
||||
@@ -99,8 +99,8 @@ namespace Microsoft.Plugin.Program.UnitTests.Storage
|
||||
string pathFromQueue = EventHandler.GetAppPathFromQueue(eventHandlingQueue, dequeueDelay);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(pathFromQueue, firstAppPath);
|
||||
Assert.AreEqual(eventHandlingQueue.Count, itemCount * 2);
|
||||
Assert.AreEqual(firstAppPath, pathFromQueue);
|
||||
Assert.AreEqual(itemCount * 2, eventHandlingQueue.Count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,13 +63,13 @@ namespace Microsoft.Plugin.Program.UnitTests.Storage
|
||||
// Act
|
||||
win32ProgramRepository.Add(item1);
|
||||
|
||||
Assert.AreEqual(win32ProgramRepository.Count(), 1);
|
||||
Assert.AreEqual(1, win32ProgramRepository.Count());
|
||||
|
||||
// To add an item with the same hashCode, ie, same name, exename and fullPath
|
||||
win32ProgramRepository.Add(item2);
|
||||
|
||||
// Assert, count still remains 1 because they are duplicate items
|
||||
Assert.AreEqual(win32ProgramRepository.Count(), 1);
|
||||
Assert.AreEqual(1, win32ProgramRepository.Count());
|
||||
}
|
||||
|
||||
[TestCase("path.appref-ms")]
|
||||
@@ -83,8 +83,8 @@ namespace Microsoft.Plugin.Program.UnitTests.Storage
|
||||
_fileSystemMocks[0].Raise(m => m.Created += null, e);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(win32ProgramRepository.Count(), 1);
|
||||
Assert.AreEqual(win32ProgramRepository.ElementAt(0).AppType, Win32Program.ApplicationType.ApprefApplication);
|
||||
Assert.AreEqual(1, win32ProgramRepository.Count());
|
||||
Assert.AreEqual(Win32Program.ApplicationType.ApprefApplication, win32ProgramRepository.ElementAt(0).AppType);
|
||||
}
|
||||
|
||||
[TestCase("directory", "path.appref-ms")]
|
||||
@@ -102,7 +102,7 @@ namespace Microsoft.Plugin.Program.UnitTests.Storage
|
||||
_fileSystemMocks[0].Raise(m => m.Deleted += null, e);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(win32ProgramRepository.Count(), 0);
|
||||
Assert.AreEqual(0, win32ProgramRepository.Count());
|
||||
}
|
||||
|
||||
[TestCase("directory", "oldpath.appref-ms", "newpath.appref-ms")]
|
||||
@@ -123,7 +123,7 @@ namespace Microsoft.Plugin.Program.UnitTests.Storage
|
||||
_fileSystemMocks[0].Raise(m => m.Renamed += null, e);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(win32ProgramRepository.Count(), 1);
|
||||
Assert.AreEqual(1, win32ProgramRepository.Count());
|
||||
Assert.IsTrue(win32ProgramRepository.Contains(newitem));
|
||||
Assert.IsFalse(win32ProgramRepository.Contains(olditem));
|
||||
}
|
||||
@@ -144,8 +144,8 @@ namespace Microsoft.Plugin.Program.UnitTests.Storage
|
||||
_fileSystemMocks[0].Raise(m => m.Created += null, e);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(win32ProgramRepository.Count(), 1);
|
||||
Assert.AreEqual(win32ProgramRepository.ElementAt(0).AppType, Win32Program.ApplicationType.Win32Application);
|
||||
Assert.AreEqual(1, win32ProgramRepository.Count());
|
||||
Assert.AreEqual(Win32Program.ApplicationType.Win32Application, win32ProgramRepository.ElementAt(0).AppType);
|
||||
}
|
||||
|
||||
[TestCase("directory", "path.exe")]
|
||||
@@ -168,7 +168,7 @@ namespace Microsoft.Plugin.Program.UnitTests.Storage
|
||||
_fileSystemMocks[0].Raise(m => m.Deleted += null, e);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(win32ProgramRepository.Count(), 0);
|
||||
Assert.AreEqual(0, win32ProgramRepository.Count());
|
||||
}
|
||||
|
||||
[TestCase("directory", "oldpath.appref-ms", "newpath.appref-ms")]
|
||||
@@ -194,7 +194,7 @@ namespace Microsoft.Plugin.Program.UnitTests.Storage
|
||||
_fileSystemMocks[0].Raise(m => m.Renamed += null, e);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(win32ProgramRepository.Count(), 1);
|
||||
Assert.AreEqual(1, win32ProgramRepository.Count());
|
||||
Assert.IsTrue(win32ProgramRepository.Contains(newitem));
|
||||
Assert.IsFalse(win32ProgramRepository.Contains(olditem));
|
||||
}
|
||||
@@ -217,7 +217,7 @@ namespace Microsoft.Plugin.Program.UnitTests.Storage
|
||||
_fileSystemMocks[0].Raise(m => m.Created += null, e);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(win32ProgramRepository.Count(), 0);
|
||||
Assert.AreEqual(0, win32ProgramRepository.Count());
|
||||
}
|
||||
|
||||
[TestCase("path.exe")]
|
||||
@@ -245,7 +245,7 @@ namespace Microsoft.Plugin.Program.UnitTests.Storage
|
||||
_fileSystemMocks[0].Raise(m => m.Changed += null, e);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(win32ProgramRepository.Count(), 0);
|
||||
Assert.AreEqual(0, win32ProgramRepository.Count());
|
||||
}
|
||||
|
||||
[TestCase("directory", "path.url")]
|
||||
@@ -268,7 +268,7 @@ namespace Microsoft.Plugin.Program.UnitTests.Storage
|
||||
_fileSystemMocks[0].Raise(m => m.Deleted += null, e);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(win32ProgramRepository.Count(), 0);
|
||||
Assert.AreEqual(0, win32ProgramRepository.Count());
|
||||
}
|
||||
|
||||
[TestCase("directory", "oldpath.url", "newpath.url")]
|
||||
@@ -294,7 +294,7 @@ namespace Microsoft.Plugin.Program.UnitTests.Storage
|
||||
_fileSystemMocks[0].Raise(m => m.Renamed += null, e);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(win32ProgramRepository.Count(), 1);
|
||||
Assert.AreEqual(1, win32ProgramRepository.Count());
|
||||
Assert.IsTrue(win32ProgramRepository.Contains(newitem));
|
||||
Assert.IsFalse(win32ProgramRepository.Contains(olditem));
|
||||
}
|
||||
@@ -326,7 +326,7 @@ namespace Microsoft.Plugin.Program.UnitTests.Storage
|
||||
_fileSystemMocks[0].Raise(m => m.Deleted += null, e);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(win32ProgramRepository.Count(), 0);
|
||||
Assert.AreEqual(0, win32ProgramRepository.Count());
|
||||
}
|
||||
|
||||
[TestCase("directory", "oldpath.lnk", "path.lnk")]
|
||||
@@ -365,7 +365,7 @@ namespace Microsoft.Plugin.Program.UnitTests.Storage
|
||||
_fileSystemMocks[0].Raise(m => m.Renamed += null, e);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(win32ProgramRepository.Count(), 1);
|
||||
Assert.AreEqual(1, win32ProgramRepository.Count());
|
||||
Assert.IsTrue(win32ProgramRepository.Contains(newitem));
|
||||
Assert.IsFalse(win32ProgramRepository.Contains(olditem));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user