public void CtorWithValue()
        {
            short          initialValue = -678;
            PixelBandShort pixelBand    = new PixelBandShort(initialValue);

            Assert.AreEqual(initialValue, pixelBand.Value);
        }
		public void SetValue()
		{
			PixelBandShort pixelBand = new PixelBandShort();
		    short newValue = 12345;
			pixelBand.Value = newValue;
			Assert.AreEqual(newValue, pixelBand.Value);
		}
Beispiel #3
0
 private void InitializeBands()
 {
     band0 = new PixelBandByte();
     band1 = new PixelBandShort();
     band2 = new PixelBandDouble();
     SetBands(band0, band1, band2);
 }
        public void SetValue()
        {
            PixelBandShort pixelBand = new PixelBandShort();
            short          newValue  = 12345;

            pixelBand.Value = newValue;
            Assert.AreEqual(newValue, pixelBand.Value);
        }
		public void SetBytes()
		{
			byte[] bytes = new byte[]{ 1, 2 };
		    short expectedValue = System.BitConverter.ToInt16(bytes, 0);

			PixelBandShort pixelBand = new PixelBandShort();
			pixelBand.SetBytes(bytes, 0);
			Assert.AreEqual(expectedValue, pixelBand.Value);
		}
        public void SetBytes()
        {
            byte[] bytes         = new byte[] { 1, 2 };
            short  expectedValue = System.BitConverter.ToInt16(bytes, 0);

            PixelBandShort pixelBand = new PixelBandShort();

            pixelBand.SetBytes(bytes, 0);
            Assert.AreEqual(expectedValue, pixelBand.Value);
        }
		public void SetThenGet()
		{
			byte[] bytes = new byte[]{ 255, 1 };
		    short expectedValue = System.BitConverter.ToInt16(bytes, 0);

			PixelBandShort pixelBand = new PixelBandShort();
			pixelBand.SetBytes(bytes, 0);
			Assert.AreEqual(expectedValue, pixelBand.Value);

			byte[] getResult = pixelBand.GetBytes();
			Assert.AreEqual(bytes.Length, getResult.Length);
			for (int i = 0; i < bytes.Length; ++i)
				Assert.AreEqual(bytes[i], getResult[i]);
		}
		public void GetBytes()
		{
			byte[] bytes = new byte[]{ 1, 2 };
		    short newValue = System.BitConverter.ToInt16(bytes, 0);

			PixelBandShort pixelBand = new PixelBandShort();
			pixelBand.Value = newValue;
			Assert.AreEqual(newValue, pixelBand.Value);

			byte[] result = pixelBand.GetBytes();
			Assert.AreEqual(bytes.Length, result.Length);
			for (int i = 0; i < bytes.Length; ++i)
				Assert.AreEqual(bytes[i], result[i]);
		}
        public void SetThenGet()
        {
            byte[] bytes         = new byte[] { 255, 1 };
            short  expectedValue = System.BitConverter.ToInt16(bytes, 0);

            PixelBandShort pixelBand = new PixelBandShort();

            pixelBand.SetBytes(bytes, 0);
            Assert.AreEqual(expectedValue, pixelBand.Value);

            byte[] getResult = pixelBand.GetBytes();
            Assert.AreEqual(bytes.Length, getResult.Length);
            for (int i = 0; i < bytes.Length; ++i)
            {
                Assert.AreEqual(bytes[i], getResult[i]);
            }
        }
        public void GetBytes()
        {
            byte[] bytes    = new byte[] { 1, 2 };
            short  newValue = System.BitConverter.ToInt16(bytes, 0);

            PixelBandShort pixelBand = new PixelBandShort();

            pixelBand.Value = newValue;
            Assert.AreEqual(newValue, pixelBand.Value);

            byte[] result = pixelBand.GetBytes();
            Assert.AreEqual(bytes.Length, result.Length);
            for (int i = 0; i < bytes.Length; ++i)
            {
                Assert.AreEqual(bytes[i], result[i]);
            }
        }
			private void InitializeBands()
			{
				band0 = new PixelBandByte();
				band1 = new PixelBandShort();
				band2 = new PixelBandDouble();
				SetBands(band0, band1, band2);
			}
        public void SetBytes_OffsetNegative()
        {
            PixelBandShort pixelBand = new PixelBandShort();

            pixelBand.SetBytes(new byte[] {}, -1);
        }
        public void SetBytes_OffsetTooBig()
        {
            PixelBandShort pixelBand = new PixelBandShort();

            pixelBand.SetBytes(new byte[] { 1, 2 }, 1);
        }
		public void CtorWithValue()
		{
		    short initialValue = -678;
			PixelBandShort pixelBand = new PixelBandShort(initialValue);
			Assert.AreEqual(initialValue, pixelBand.Value);
		}
		public void DefaultCtor()
		{
			PixelBandShort pixelBand = new PixelBandShort();
			Assert.AreEqual(0, pixelBand.Value);
		}
		public void SetBytes_OffsetTooBig()
		{
			PixelBandShort pixelBand = new PixelBandShort();
			pixelBand.SetBytes(new byte[]{1, 2}, 1);
		}
		public void SetBytes_OffsetNegative()
		{
			PixelBandShort pixelBand = new PixelBandShort();
			pixelBand.SetBytes(new byte[]{}, -1);
		}
        public void SetBytes_Null()
        {
            PixelBandShort pixelBand = new PixelBandShort();

            pixelBand.SetBytes(null, 0);
        }
		public void SetBytes_Null()
		{
			PixelBandShort pixelBand = new PixelBandShort();
			pixelBand.SetBytes(null, 0);
		}
        public void DefaultCtor()
        {
            PixelBandShort pixelBand = new PixelBandShort();

            Assert.AreEqual(0, pixelBand.Value);
        }
		public void TypeCode()
		{
			PixelBandShort pixelBand = new PixelBandShort();
			Assert.AreEqual(System.TypeCode.Int16, pixelBand.TypeCode);
		}
        public void TypeCode()
        {
            PixelBandShort pixelBand = new PixelBandShort();

            Assert.AreEqual(System.TypeCode.Int16, pixelBand.TypeCode);
        }