Compare commits

..

7 Commits

Author SHA1 Message Date
ColinD e89f01ed51 Another try 2019-07-14 22:40:45 +01:00
ColinD 2846e9f719 Anotther try. 2019-07-14 22:32:38 +01:00
ColinD a7904d7485 Another attempt at the version number rename. 2019-07-14 22:28:32 +01:00
ColinD 12c11b4987 Removed unneeded comments 2019-07-14 22:19:55 +01:00
ColinD 07569b146e Trying the nant variable inside the string. 2019-07-14 22:19:05 +01:00
ColinD 112fdf0bb9 Experiment on build.build to see if I can rename the msi file 2019-07-14 22:14:43 +01:00
ColinD 73e8e8ffe8 More unit testing 2019-07-14 22:05:25 +01:00
2 changed files with 39 additions and 0 deletions
@@ -1291,5 +1291,37 @@ namespace Meade.net.Telescope.UnitTests
_sharedResourcesWrapperMock.Verify(x => x.SendChar(expectedCommand), Times.Once); _sharedResourcesWrapperMock.Verify(x => x.SendChar(expectedCommand), Times.Once);
} }
[Test]
public void SiteLongitude_Get_WhenNotConnected_ThenThrowsException()
{
_sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(() => _sharedResourcesWrapperMock.Object.AUTOSTAR497);
_sharedResourcesWrapperMock.Setup(x => x.FirmwareVersion).Returns(() => _sharedResourcesWrapperMock.Object.AUTOSTAR497_31EE);
var exception = Assert.Throws<NotConnectedException>(() => { var result = _telescope.SiteLongitude; });
Assert.That(exception.Message, Is.EqualTo("Not connected to telescope when trying to execute: SiteLongitude Get"));
}
//todo figure out if this is right. don't feel right to me
[TestCase("5", 5, -5)]
[TestCase("-5", -5, 5)]
[TestCase("185", 185, 175)]
[TestCase("350", 350, 10)]
public void SiteLongitude_Get_WhenConnected_ThenRetrivesAndReturnsExpectedValue(string telescopelongitudeString, double telescopeLongitudeValue, double expectedResult)
{
var telescopeLongitude = "testLongitude";
_sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(() => _sharedResourcesWrapperMock.Object.AUTOSTAR497);
_sharedResourcesWrapperMock.Setup(x => x.FirmwareVersion).Returns(() => _sharedResourcesWrapperMock.Object.AUTOSTAR497_31EE);
_telescope.Connected = true;
_sharedResourcesWrapperMock.Setup(x => x.SendString(":Gg#")).Returns(telescopeLongitude);
_utilMock.Setup(x => x.DMSToDegrees(telescopeLongitude)).Returns(telescopeLongitudeValue);
var result = _telescope.SiteLongitude;
Assert.That(result, Is.EqualTo(expectedResult));
}
} }
} }
+7
View File
@@ -4,6 +4,7 @@
<property name="solution.directory" value="${directory::get-current-directory()}"/> <property name="solution.directory" value="${directory::get-current-directory()}"/>
<property name="build.output.directory" value="${solution.directory}\${outputDir}"/> <property name="build.output.directory" value="${solution.directory}\${outputDir}"/>
<property name="AssemblyVersionUpdater" value="${build.number}"/>
<target name="setup"> <target name="setup">
<delete dir="${build.output.directory}"/> <delete dir="${build.output.directory}"/>
@@ -32,5 +33,11 @@
<include name="**/*" /> <include name="**/*" />
</fileset> </fileset>
</copy> </copy>
<foreach item="File" in="${build.output.directory}" property="fileName">
<if test="${string::to-lower(path::get-extension(fileName)) == '.msi'}">
<move file="${fileName}" tofile="${path::combine(path::get-directory-name(fileName), path::get-file-name-without-extension(fileName) + '${AssemblyVersionUpdater}.msi')}" />
</if>
</foreach>
</target> </target>
</project> </project>