mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
[FileExplorer] StlThumbnailProvider (#15568)
* Adds StlThumbnailProvider * Spell checker fixes * Adds missing changes * Attempts to fix alpha background issue * Adds missing dependency references * Upgrades .NET Core 3.1 to .NET 5 * Updates Helix Toolkit to fix .net5 compatibility * Return null bitmap If STL model is empty
This commit is contained in:
@@ -63,6 +63,7 @@ namespace ViewModelTests
|
||||
Assert.AreEqual(originalSettings.Properties.EnableSvgThumbnail, viewModel.SVGThumbnailIsEnabled);
|
||||
Assert.AreEqual(originalSettings.Properties.EnablePdfThumbnail, viewModel.PDFThumbnailIsEnabled);
|
||||
Assert.AreEqual(originalSettings.Properties.EnableGcodeThumbnail, viewModel.GCODEThumbnailIsEnabled);
|
||||
Assert.AreEqual(originalSettings.Properties.EnableStlThumbnail, viewModel.STLThumbnailIsEnabled);
|
||||
|
||||
// Verify that the stub file was used
|
||||
var expectedCallCount = 2; // once via the view model, and once by the test (GetSettings<T>)
|
||||
@@ -141,6 +142,24 @@ namespace ViewModelTests
|
||||
viewModel.GCODEThumbnailIsEnabled = true;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void STLThumbnailIsEnabledShouldPrevHandlerWhenSuccessful()
|
||||
{
|
||||
// Assert
|
||||
Func<string, int> sendMockIPCConfigMSG = msg =>
|
||||
{
|
||||
SndModuleSettings<SndPowerPreviewSettings> snd = JsonSerializer.Deserialize<SndModuleSettings<SndPowerPreviewSettings>>(msg);
|
||||
Assert.IsTrue(snd.PowertoysSetting.FileExplorerPreviewSettings.Properties.EnableStlThumbnail);
|
||||
return 0;
|
||||
};
|
||||
|
||||
// arrange
|
||||
PowerPreviewViewModel viewModel = new PowerPreviewViewModel(SettingsRepository<PowerPreviewSettings>.GetInstance(mockPowerPreviewSettingsUtils.Object), SettingsRepository<GeneralSettings>.GetInstance(mockGeneralSettingsUtils.Object), sendMockIPCConfigMSG, PowerPreviewSettings.ModuleName);
|
||||
|
||||
// act
|
||||
viewModel.STLThumbnailIsEnabled = true;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void MDRenderIsEnabledShouldPrevHandlerWhenSuccessful()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user