-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
2,232 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using boilersGraphics.Adorners; | ||
using boilersGraphics.Controls; | ||
using boilersGraphics.ViewModels; | ||
using NUnit.Framework; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Media; | ||
|
||
namespace boilersGraphics.Test | ||
{ | ||
[TestFixture] | ||
public class AdornerTest | ||
{ | ||
[Test, RequiresThread(System.Threading.ApartmentState.STA)] | ||
public void BezierCurveAdornerを作成() | ||
{ | ||
var diagramViewModel = new DiagramViewModel(new MainWindowViewModel(null), 100, 100); | ||
var designerCanvas = new DesignerCanvas(); | ||
designerCanvas.DataContext = diagramViewModel; | ||
diagramViewModel.EdgeColors.Add(Colors.Red); | ||
diagramViewModel.EdgeThickness.Value = 1.0; | ||
var adorner = new BezierCurveAdorner(designerCanvas, new System.Windows.Point() { X = 100, Y = 100 }); | ||
var po = new Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject(adorner); | ||
Assert.That(po.GetField("_designerCanvas"), Is.EqualTo(designerCanvas)); | ||
Assert.That(po.GetField("_startPoint"), Is.EqualTo(new System.Windows.Point() { X = 100, Y = 100 })); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
boilersGraphics.Test/Microsoft.VisualStudio.TestTools.UnitTesting/Helper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace Microsoft.VisualStudio.TestTools.UnitTesting | ||
{ | ||
using System; | ||
|
||
/// <summary> | ||
/// The helper. | ||
/// </summary> | ||
internal static class Helper | ||
{ | ||
/// <summary> | ||
/// The check parameter not null. | ||
/// </summary> | ||
/// <param name="param"> | ||
/// The parameter. | ||
/// </param> | ||
/// <param name="parameterName"> | ||
/// The parameter name. | ||
/// </param> | ||
/// <param name="message"> | ||
/// The message. | ||
/// </param> | ||
/// <exception cref="ArgumentNullException"> Throws argument null exception when parameter is null. </exception> | ||
internal static void CheckParameterNotNull(object param, string parameterName, string message) | ||
{ | ||
if (param == null) | ||
{ | ||
throw new ArgumentNullException(parameterName, message); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// The check parameter not null or empty. | ||
/// </summary> | ||
/// <param name="param"> | ||
/// The parameter. | ||
/// </param> | ||
/// <param name="parameterName"> | ||
/// The parameter name. | ||
/// </param> | ||
/// <param name="message"> | ||
/// The message. | ||
/// </param> | ||
/// <exception cref="ArgumentException"> Throws ArgumentException when parameter is null. </exception> | ||
internal static void CheckParameterNotNullOrEmpty(string param, string parameterName, string message) | ||
{ | ||
if (string.IsNullOrEmpty(param)) | ||
{ | ||
throw new ArgumentException(message, parameterName); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.