Skip to content

Commit

Permalink
Merge branch 'release/v9.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
dhq-boiler committed Feb 15, 2023
2 parents e276966 + e74382f commit 92769a5
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 6 deletions.
7 changes: 7 additions & 0 deletions ReleaseNote.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@

# リリースノート

## v9.0.1

### バグフィックス

* ユニットテスト中に NullReferenceException が発生するバグを修正しました。
* ユニットテストを修正しました。

## v9

### 新機能
Expand Down
50 changes: 44 additions & 6 deletions boilersGraphics.Test/BoundaryTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using boilersGraphics.ViewModels;
using Moq;
using NUnit.Framework;
using Prism.Services.Dialogs;
using System;
using System.Windows;

Expand All @@ -8,9 +10,15 @@ namespace boilersGraphics.Test
[TestFixture]
public class BoundaryTest
{
[Test]
[Test, Apartment(System.Threading.ApartmentState.STA)]
public void Basic()
{
boilersGraphics.App.IsTest = true;

var dlgService = new Mock<IDialogService>();
MainWindowViewModel mainWindowViewModel = new MainWindowViewModel(dlgService.Object);
var diagramViewModel = new DiagramViewModel(mainWindowViewModel);

var diagrams = new SelectableDesignerItemViewModelBase[]
{
new NRectangleViewModel(10, 10, 10, 10)
Expand All @@ -21,9 +29,15 @@ public void Basic()
Assert.That(actual, Is.EqualTo(new Rect(10, 10, 10, 10)));
}

[Test]
[Test, Apartment(System.Threading.ApartmentState.STA)]
public void Rotate_45()
{
boilersGraphics.App.IsTest = true;

var dlgService = new Mock<IDialogService>();
MainWindowViewModel mainWindowViewModel = new MainWindowViewModel(dlgService.Object);
var diagramViewModel = new DiagramViewModel(mainWindowViewModel);

var diagrams = new SelectableDesignerItemViewModelBase[]
{
new NRectangleViewModel(10, 10, 10, 10, 45)
Expand All @@ -34,9 +48,15 @@ public void Rotate_45()
Assert.That(actual, Is.EqualTo(new Rect(15 - 5 * Math.Sqrt(2), 15 - 5 * Math.Sqrt(2), 10 * Math.Sqrt(2), 10 * Math.Sqrt(2))));
}

[Test]
[Test, Apartment(System.Threading.ApartmentState.STA)]
public void Rotate_90()
{
boilersGraphics.App.IsTest = true;

var dlgService = new Mock<IDialogService>();
MainWindowViewModel mainWindowViewModel = new MainWindowViewModel(dlgService.Object);
var diagramViewModel = new DiagramViewModel(mainWindowViewModel);

var diagrams = new SelectableDesignerItemViewModelBase[]
{
new NRectangleViewModel(10, 10, 10, 10, 90)
Expand All @@ -47,9 +67,15 @@ public void Rotate_90()
Assert.That(actual, Is.EqualTo(new Rect(10, 10, 10, 10)));
}

[Test]
[Test, Apartment(System.Threading.ApartmentState.STA)]
public void Rotate_180()
{
boilersGraphics.App.IsTest = true;

var dlgService = new Mock<IDialogService>();
MainWindowViewModel mainWindowViewModel = new MainWindowViewModel(dlgService.Object);
var diagramViewModel = new DiagramViewModel(mainWindowViewModel);

var diagrams = new SelectableDesignerItemViewModelBase[]
{
new NRectangleViewModel(10, 10, 10, 10, 180)
Expand All @@ -60,9 +86,15 @@ public void Rotate_180()
Assert.That(actual, Is.EqualTo(new Rect(10, 10, 10, 10)));
}

[Test]
[Test, Apartment(System.Threading.ApartmentState.STA)]
public void Multiple_2()
{
boilersGraphics.App.IsTest = true;

var dlgService = new Mock<IDialogService>();
MainWindowViewModel mainWindowViewModel = new MainWindowViewModel(dlgService.Object);
var diagramViewModel = new DiagramViewModel(mainWindowViewModel);

var diagrams = new SelectableDesignerItemViewModelBase[]
{
new NRectangleViewModel(10, 10, 10, 10),
Expand All @@ -74,9 +106,15 @@ public void Multiple_2()
Assert.That(actual, Is.EqualTo(new Rect(10, 10, 20, 20)));
}

[Test]
[Test, Apartment(System.Threading.ApartmentState.STA)]
public void Multiple_3()
{
boilersGraphics.App.IsTest = true;

var dlgService = new Mock<IDialogService>();
MainWindowViewModel mainWindowViewModel = new MainWindowViewModel(dlgService.Object);
var diagramViewModel = new DiagramViewModel(mainWindowViewModel);

var diagrams = new SelectableDesignerItemViewModelBase[]
{
new NRectangleViewModel(10, 10, 10, 10),
Expand Down
5 changes: 5 additions & 0 deletions boilersGraphics/ViewModels/DiagramViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3368,6 +3368,11 @@ private int Count(List<FrameworkElement> allViews)
/// </summary>
private void ScanEffectViewModelObjects()
{
if (boilersGraphics.App.IsTest)
{
return;
}

App.Current.Dispatcher.BeginInvoke(() =>
{
foreach (var item in AllItems.Value.OrderBy(x => x.ZIndex.Value))
Expand Down

0 comments on commit 92769a5

Please sign in to comment.