コード例 #1
0
 public virtual void TestGetAutoFlashCompensationDescription()
 {
     NikonType2MakernoteDirectory directory = new NikonType2MakernoteDirectory();
     NikonType2MakernoteDescriptor descriptor = new NikonType2MakernoteDescriptor(directory);
     // no entry exists
     NUnit.Framework.Assert.IsNull(descriptor.GetAutoFlashCompensationDescription());
     directory.SetByteArray(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { unchecked((int)(0x06)), unchecked((int)(0x01)), unchecked((int)(0x06)) });
     Sharpen.Tests.AreEqual("1 EV", descriptor.GetAutoFlashCompensationDescription());
     directory.SetByteArray(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { unchecked((int)(0x04)), unchecked((int)(0x01)), unchecked((int)(0x06)) });
     Sharpen.Tests.AreEqual("0.67 EV", descriptor.GetAutoFlashCompensationDescription());
     directory.SetByteArray(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { unchecked((int)(0x02)), unchecked((int)(0x01)), unchecked((int)(0x06)) });
     Sharpen.Tests.AreEqual("0.33 EV", descriptor.GetAutoFlashCompensationDescription());
     directory.SetByteArray(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { unchecked((sbyte)0xFE), unchecked((int)(0x01)), unchecked((int)(0x06)) });
     Sharpen.Tests.AreEqual("-0.33 EV", descriptor.GetAutoFlashCompensationDescription());
 }
コード例 #2
0
 public void TestGetAutoFlashCompensationDescription()
 {
     var directory = new NikonType2MakernoteDirectory();
     var descriptor = new NikonType2MakernoteDescriptor(directory);
     // no entry exists
     Assert.Null(descriptor.GetAutoFlashCompensationDescription());
     directory.Set(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { 0x06, 0x01, 0x06 });
     Assert.Equal("1 EV", descriptor.GetAutoFlashCompensationDescription());
     directory.Set(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { 0x04, 0x01, 0x06 });
     Assert.Equal("0.67 EV", descriptor.GetAutoFlashCompensationDescription());
     directory.Set(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { 0x02, 0x01, 0x06 });
     Assert.Equal("0.33 EV", descriptor.GetAutoFlashCompensationDescription());
     directory.Set(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { unchecked((sbyte)0xFE), 0x01, 0x06 });
     Assert.Equal("-0.33 EV", descriptor.GetAutoFlashCompensationDescription());
 }
        public void TestGetAutoFlashCompensationDescription()
        {
            var directory  = new NikonType2MakernoteDirectory();
            var descriptor = new NikonType2MakernoteDescriptor(directory);

            // no entry exists
            Assert.Null(descriptor.GetAutoFlashCompensationDescription());
            directory.Set(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { 0x06, 0x01, 0x06 });
            Assert.Equal("1 EV", descriptor.GetAutoFlashCompensationDescription());
            directory.Set(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { 0x04, 0x01, 0x06 });
            Assert.Equal("0.67 EV", descriptor.GetAutoFlashCompensationDescription());
            directory.Set(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { 0x02, 0x01, 0x06 });
            Assert.Equal("0.33 EV", descriptor.GetAutoFlashCompensationDescription());
            directory.Set(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { unchecked ((sbyte)0xFE), 0x01, 0x06 });
            Assert.Equal("-0.33 EV", descriptor.GetAutoFlashCompensationDescription());
        }
コード例 #4
0
        public virtual void TestGetAutoFlashCompensationDescription()
        {
            NikonType2MakernoteDirectory  directory  = new NikonType2MakernoteDirectory();
            NikonType2MakernoteDescriptor descriptor = new NikonType2MakernoteDescriptor(directory);

            // no entry exists
            NUnit.Framework.Assert.IsNull(descriptor.GetAutoFlashCompensationDescription());
            directory.SetByteArray(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { unchecked ((int)(0x06)), unchecked ((int)(0x01)), unchecked ((int)(0x06)) });
            Sharpen.Tests.AreEqual("1 EV", descriptor.GetAutoFlashCompensationDescription());
            directory.SetByteArray(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { unchecked ((int)(0x04)), unchecked ((int)(0x01)), unchecked ((int)(0x06)) });
            Sharpen.Tests.AreEqual("0.67 EV", descriptor.GetAutoFlashCompensationDescription());
            directory.SetByteArray(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { unchecked ((int)(0x02)), unchecked ((int)(0x01)), unchecked ((int)(0x06)) });
            Sharpen.Tests.AreEqual("0.33 EV", descriptor.GetAutoFlashCompensationDescription());
            directory.SetByteArray(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { unchecked ((sbyte)unchecked ((int)(0xFE))), unchecked ((int)(0x01)), unchecked ((int)(0x06)) });
            Sharpen.Tests.AreEqual("-0.33 EV", descriptor.GetAutoFlashCompensationDescription());
        }