Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #400 from Esri/dev
Browse files Browse the repository at this point in the history
Version 2.1 for Military Tools 1.1
  • Loading branch information
kgonzago authored Jun 5, 2017
2 parents 8672217 + 6de5e6c commit aaffd86
Show file tree
Hide file tree
Showing 53 changed files with 17,063 additions and 465 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,14 @@ Anyone and everyone is welcome to contribute. Please see our [guidelines for con

### Repository Points of Contact

#### Repository Owner: [Joe](https://github.com/jmccausland)
#### Repository Owner: [Kevin](https://github.com/kgonzago)

* Merge Pull Requests
* Creates Releases and Tags
* Manages Milestones
* Manages and Assigns Issues

#### Secondary: [Lyle](https://github.com/topowright)
#### Secondary: [Patrick](https://github.com/pHill5136)

* Backup when the Owner is away

Expand All @@ -205,5 +205,5 @@ limitations under the License.

A copy of the license is available in the repository's [license.txt](license.txt) file.

[](Esri Tags: Military Analyst Defense ArcGIS ArcObjects .NET WPF ArcGISSolutions ArcMap ArcPro Add-In)
[](Esri Language: C#)
[](Esri Tags: Military Analyst Defense ArcGIS ArcObjects .NET WPF ArcGISSolutions ArcMap ArcPro Add-In Military-Tools-for-ArcGIS)
[](Esri Language: C-Sharp)
6 changes: 0 additions & 6 deletions source/DistanceAndDirection/.nuget/NuGet.Config

This file was deleted.

144 changes: 0 additions & 144 deletions source/DistanceAndDirection/.nuget/NuGet.targets

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
<SpecificVersion>False</SpecificVersion>
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="ESRI.ArcGIS.Version, Version=10.3.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86, processorArchitecture=MSIL" />
<Reference Include="ESRI.ArcGIS.Version, Version=10.3.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="System" />
<Reference Include="System.Windows" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@ public void LinesViewModel_ThrowsException6()
lineVM.Azimuth = -1;
}

[TestMethod]
[ExpectedException(typeof(ArgumentException))]
public void LinesViewModel_ThrowsException7()
{
var lineVM = new LinesViewModel();

lineVM.Azimuth = 361;
}


[TestMethod]
public void LineViewModel()
Expand Down Expand Up @@ -130,8 +139,18 @@ public void LineViewModel()
Assert.AreEqual(50.5, lineVM.Distance);
lineVM.LineDistanceType = DistanceAndDirectionLibrary.DistanceTypes.Miles;
Assert.AreEqual(50.5, lineVM.Distance);

// Check TrimPrecision is trimming correctly according to LineDistanceType
lineVM.LineDistanceType = DistanceTypes.Kilometers;
lineVM.Distance = 1.012345;
Assert.AreEqual(1.0123, lineVM.Distance);

lineVM.LineDistanceType = DistanceTypes.Meters;
lineVM.Distance = 1.12;
Assert.AreEqual(1.1, lineVM.Distance);
}


#endregion Lines View Model

#region Circle View Model
Expand Down Expand Up @@ -170,6 +189,84 @@ public void CircleViewModel_ThrowsException4()
circleVM.TravelRate = -1;
}

[TestMethod]
[ExpectedException(typeof(ArgumentException))]
public void CircleViewModel_ThrowsException5()
{
var circleVM = new CircleViewModel();

circleVM.TimeUnit = TimeUnits.Hours;
circleVM.RateTimeUnit = RateTimeTypes.MetersHour;
circleVM.TravelTime = 1;
circleVM.TravelRate = 20000000;
circleVM.RateUnit = DistanceTypes.Miles;
}

[TestMethod]
[ExpectedException(typeof(ArgumentException))]
public void CircleViewModel_ThrowsException6()
{
var circleVM = new CircleViewModel();

circleVM.TimeUnit = TimeUnits.Seconds;
circleVM.RateTimeUnit = RateTimeTypes.MetersSec;
circleVM.TravelTime = 1;
circleVM.TravelRate = 20000000;
circleVM.TimeUnit = TimeUnits.Hours;
}

[TestMethod]
[ExpectedException(typeof(ArgumentException))]
public void CircleViewModel_ThrowsException7()
{
var circleVM = new CircleViewModel();

circleVM.TimeUnit = TimeUnits.Hours;
circleVM.RateTimeUnit = RateTimeTypes.MetersHour;
circleVM.TravelTime = 1;
circleVM.TravelRate = 20000001;
}

[TestMethod]
[ExpectedException(typeof(ArgumentException))]
public void CircleViewModel_ThrowsException8()
{
var circleVM = new CircleViewModel();

circleVM.TimeUnit = TimeUnits.Hours;
circleVM.RateTimeUnit = RateTimeTypes.MetersHour;
circleVM.TravelTime = 2;
circleVM.TravelRate = 10000001;
}

[TestMethod]
[ExpectedException(typeof(ArgumentException))]
public void CircleViewModel_ThrowsException9()
{
var circleVM = new CircleViewModel();

circleVM.Point1Formatted = "0 0";
circleVM.DistanceString = "20000001";
}

[TestMethod]
[ExpectedException(typeof(ArgumentException))]
public void CircleViewModel_ThrowsException10()
{
var circleVM = new CircleViewModel();

circleVM.Point1Formatted = "0 181";
}

[TestMethod]
[ExpectedException(typeof(ArgumentException))]
public void CircleViewModel_ThrowsException11()
{
var circleVM = new CircleViewModel();

circleVM.Point1Formatted = "91 0";
}

[TestMethod]
public void CircleViewModel()
{
Expand All @@ -184,6 +281,16 @@ public void CircleViewModel()
circleVM.Point1 = new Point() { X = -119.8, Y = 34.4 };

Assert.AreEqual(circleVM.Point1Formatted, "34.4 -119.8");

// Check that Distance is not converted when LineDistanceType is changed
// #260
circleVM.LineDistanceType = DistanceTypes.Meters;
circleVM.Distance = 1000.0;
circleVM.LineDistanceType = DistanceTypes.Kilometers;
Assert.AreEqual(circleVM.Distance, 1000.0);

circleVM.CircleType = CircleFromTypes.Diameter;
Assert.AreEqual(circleVM.DistanceString, "1000");
}

#endregion Circle View Model
Expand Down Expand Up @@ -267,6 +374,24 @@ public void EllipseViewModel_ThrowsException6()

ellipseVM.Azimuth = -1;
}
[TestMethod]
[ExpectedException(typeof(ArgumentException))]
public void EllipseViewModel_ThrowsException7()
{
var ellipseVM = new EllipseViewModel();

ellipseVM.MajorAxisDistance = ellipseVM.MajorAxisLimit + 1;
}
[TestMethod]
[ExpectedException(typeof(ArgumentException))]
public void EllipseViewModel_ThrowsException8()
{
var ellipseVM = new EllipseViewModel();

ellipseVM.LineDistanceType = DistanceTypes.Meters;
ellipseVM.MajorAxisDistance = ellipseVM.MajorAxisLimit;
ellipseVM.LineDistanceType = DistanceTypes.Miles;
}

#endregion Ellipse View Model

Expand Down Expand Up @@ -304,6 +429,26 @@ public void RangeViewModel_ThrowsException4()
rangeVM.DistanceString = "esri";
}

[TestMethod]
[ExpectedException(typeof(ArgumentException))]
public void RangeViewModel_ThrowsException5()
{
var rangeVM = new RangeViewModel();

rangeVM.Distance = 20000001;
}

[TestMethod]
[ExpectedException(typeof(ArgumentException))]
public void RangeViewModel_ThrowsException6()
{
var rangeVM = new RangeViewModel();

rangeVM.LineDistanceType = DistanceTypes.Meters;
rangeVM.Distance = 20000000;
rangeVM.LineDistanceType = DistanceTypes.Miles;
}

[TestMethod]
public void RangeViewModel()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<Name>Distance and Direction</Name>
<AddInID>{3e1d78f8-72a5-4463-ad11-0524a5913c9d}</AddInID>
<Description>Create Lines, Circles, Ellipses and Range Rings</Description>
<Version>1.0</Version>
<Version>2.1</Version>
<Image>Images\ArcMapAddinDistanceAndDirection.png</Image>
<Author>Esri</Author>
<Company>Esri</Company>
<Date>1/25/2016</Date>
<Date>6/1/2017</Date>
<Targets>
<Target name="Desktop" version="10.3" />
</Targets>
Expand All @@ -23,4 +23,4 @@
</Commands>
</ArcMap>
</AddIn>
</ESRI.Configuration>
</ESRI.Configuration>
Loading

0 comments on commit aaffd86

Please sign in to comment.