Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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");
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
        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);
        }
Exemplo n.º 9
0
        public void FITSOriginalValue_DoubleTest(double value)
        {
            var card = new FITSHeaderCard("KEY", value, string.Empty);

            card.OriginalValue.Should().Be(value.ToString("0.0##############", CultureInfo.InvariantCulture));
        }
Exemplo n.º 10
0
        public void FITSOriginalValue_StringTest(int value)
        {
            var card = new FITSHeaderCard("KEY", value, string.Empty);

            card.OriginalValue.Should().Be(value.ToString());
        }