Added NotSupportedException on ResizedObject.Position

This commit is contained in:
Michael Smith 2016-02-19 17:48:28 -08:00
parent 80c400dee8
commit 0141538a2d
3 changed files with 24 additions and 1 deletions

View File

@ -65,6 +65,7 @@
<Compile Include="Booleans\DifferenceTests.cs" />
<Compile Include="Booleans\IntersectionTests.cs" />
<Compile Include="Transforms\MinkowskiTests.cs" />
<Compile Include="Transforms\ResizeTests.cs" />
<Compile Include="Transforms\ScaleTests.cs" />
</ItemGroup>
<ItemGroup>

View File

@ -0,0 +1,22 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OSCADSharp.Solids;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OSCADSharp.UnitTests.Transforms
{
[TestClass]
public class ResizeTests
{
[TestMethod]
[ExpectedException(typeof(NotSupportedException))]
public void Resize_PositionNotSupportedAfterResize()
{
var pos = new Cube(5, 5, 20)
.Translate(30, 0, 0).Rotate(0, 90, 0).Resize(2, 2, 2).Position();
}
}
}

View File

@ -51,7 +51,7 @@ namespace OSCADSharp.Transforms
public override Vector3 Position()
{
return obj.Position();
throw new NotSupportedException("Position is not supported on Resized objects.");
}
}
}