public void FITSHeaderCard_NullTest() { var key = "SOME"; string value = null; string comment = null; var sut = new FITSHeaderCard(key, value, comment); sut.Key.Should().Be(key); sut.Value.Should().Be("'' "); sut.Comment.Should().Be(string.Empty); }
public void FITSHeaderCardIntTest() { var key = "SOME"; var value = 113; var comment = "some comment"; var sut = new FITSHeaderCard(key, value, comment); sut.Key.Should().Be(key); sut.Value.Should().Be(value.ToString()); sut.Comment.Should().Be(comment); }
public void FITSHeaderCardDoubleTest(double value, string expectedValue) { var key = "SOME"; var comment = "some comment"; var sut = new FITSHeaderCard(key, value, comment); sut.Key.Should().Be(key); sut.Value.Should().Be(expectedValue); sut.Comment.Should().Be(comment); sut.Value.Length.Should().BeLessThan(21); }
public void FITSGainNegativeValueTest() { var metaData = new ImageMetaData(); metaData.Camera.Gain = -1; var notExpectedCard = new FITSHeaderCard("GAIN", metaData.Camera.Gain, "Sensor gain"); var sut = new FITS(new ushort[] { 1, 2 }, 1, 1); sut.PopulateHeaderCards(metaData); sut.Header.HeaderCards.Should().NotContain(notExpectedCard, "Negative Gain values are not allowed"); }
public void FITSHeaderCardDateTest() { var key = "SOME"; var value = new DateTime(2012, 1, 10, 1, 20, 12, 111); var comment = "some comment"; var sut = new FITSHeaderCard(key, value, comment); var expectedValue = "'2012-01-10T01:20:12.111'"; sut.Key.Should().Be(key); sut.Value.Should().Be(expectedValue); sut.Comment.Should().Be(comment); }
public void FITSHeaderCardStringTest() { var key = "SOME"; var value = "someone's value"; var comment = "some comment"; var sut = new FITSHeaderCard(key, value, comment); var expectedValue = "'someone''s value' "; sut.Key.Should().Be(key); sut.Value.Should().Be(expectedValue); sut.Comment.Should().Be(comment); }
public void FITSHeaderCardLongStringTest() { var key = "SOME"; var value = "QXuUfwRN6t5OumSP9fFoWki4vUIvBXwFVYIDKROyCscAZ9ealUZdQKFzukzaNR6byrZdVUfKCHUwFfzex1iYNFBf1uVobcEX1e5m"; var comment = "QXuUfwRN6t5OumSP9fFoWki4vUIvBXwFVYIDKROyCscAZ9ealUZdQKFzukzaNR6byrZdVUfKCHUwFfzex1iYNFBf1uVobcEX1e5m"; var sut = new FITSHeaderCard(key, value, comment); var expectedValue = "'QXuUfwRN6t5OumSP9f'"; var expectedComment = "QXuUfwRN6t5OumSP9fFoWki4vUIvBXwFVYIDKROyCscAZ"; sut.Key.Should().Be(key); sut.Value.Should().Be(expectedValue); sut.Comment.Should().Be(expectedComment); }
public void FITSHeaderCardBoolTest() { var key = "SOME"; var value = true; var comment = "some comment"; var sut = new FITSHeaderCard(key, value, comment); var sut2 = new FITSHeaderCard(key, !value, comment); var expectedValue = "T"; sut.Key.Should().Be(key); sut.Value.Should().Be(expectedValue); sut.Comment.Should().Be(comment); var expectedValue2 = "F"; sut2.Key.Should().Be(key); sut2.Value.Should().Be(expectedValue2); sut2.Comment.Should().Be(comment); }
public void FITSOriginalValue_DoubleTest(double value) { var card = new FITSHeaderCard("KEY", value, string.Empty); card.OriginalValue.Should().Be(value.ToString("0.0##############", CultureInfo.InvariantCulture)); }
public void FITSOriginalValue_StringTest(int value) { var card = new FITSHeaderCard("KEY", value, string.Empty); card.OriginalValue.Should().Be(value.ToString()); }