public void ReadTagTest() { // Arrange int type = 5; double[] parameters = new double[] { 0.45, Math.Pow(1.099, 1.0 / 0.45), 0.0, 4.5, 0.018, -0.099, 0.0 }; using (var red = ToneCurve.BuildParametric(null, type, parameters)) using (var green = ToneCurve.BuildParametric(null, type, parameters)) using (var blue = ToneCurve.BuildParametric(null, type, parameters)) { var target = new VideoCardGamma(red, green, blue); using (var profile = Profile.CreatePlaceholder(null)) { profile.WriteTag(TagSignature.Vcgt, target); // Act var actual = profile.ReadTag <VideoCardGamma>(TagSignature.Vcgt); var actualRed = actual.Red; var actualGreen = actual.Green; var actualBlue = actual.Blue; // Assert Assert.IsNotNull(actualRed); Assert.IsNotNull(actualGreen); Assert.IsNotNull(actualBlue); } } }
public void ConstructorTest() { // Arrange int type = 5; double[] parameters = new double[] { 0.45, Math.Pow(1.099, 1.0 / 0.45), 0.0, 4.5, 0.018, -0.099, 0.0 }; using (var expectedRed = ToneCurve.BuildParametric(null, type, parameters)) using (var expectedGreen = ToneCurve.BuildParametric(null, type, parameters)) using (var expectedBlue = ToneCurve.BuildParametric(null, type, parameters)) { // Act var target = new VideoCardGamma(expectedRed, expectedGreen, expectedBlue); var actualRed = target.Red; var actualGreen = target.Green; var actualBlue = target.Blue; // Assert Assert.AreSame(expectedRed, actualRed); Assert.AreSame(expectedGreen, actualGreen); Assert.AreSame(expectedBlue, actualBlue); } }