chroma-sdk / Colore

Compare eadd3be ... +5 ... 2ca0c69

Coverage Reach
Effects/Keyboard/ExtendedCustomKeyboardEffect.cs Effects/Keyboard/CustomKeyboardEffect.cs Effects/Keyboard/DeathstalkerGridEffect.cs Effects/Keyboard/PositionData.cs Effects/Keyboard/StaticKeyboardEffect.cs Effects/Mouse/CustomMouseEffect.cs Effects/Mouse/StaticMouseEffect.cs Effects/Keypad/CustomKeypadEffect.cs Effects/Keypad/StaticKeypadEffect.cs Effects/ChromaLink/CustomChromaLinkEffect.cs Effects/ChromaLink/StaticChromaLinkEffect.cs Effects/Headset/CustomHeadsetEffect.cs Effects/Headset/StaticHeadsetEffect.cs Effects/Mousepad/CustomMousepadEffect.cs Effects/Mousepad/StaticMousepadEffect.cs Effects/Generic/NoneEffect.cs Data/Result.cs Data/Devices.cs Data/AppInfo.cs Data/Color.cs Data/SdkVersion.cs Data/Author.cs Data/DeviceInfo.cs Data/SdkDeviceInfo.cs Data/Color.Defines.cs Native/NativeApi.cs Native/NativeSdkMethods.cs Native/NativeCallException.cs Serialization/ResultConverter.cs Serialization/ColorConverter.cs Serialization/KeyboardExtendedCustomConverter.cs Serialization/MouseStaticConverter.cs Serialization/ChromaLinkStaticConverter.cs Serialization/ChromaLinkCustomConverter.cs Serialization/KeypadCustomConverter.cs Serialization/DeathstalkerGridConverter.cs Serialization/KeyboardCustomConverter.cs Serialization/MouseCustomConverter.cs Serialization/HeadsetStaticConverter.cs Serialization/MousepadCustomConverter.cs Serialization/KeyboardStaticConverter.cs Serialization/MousepadStaticConverter.cs Serialization/KeypadStaticConverter.cs Serialization/HeadsetCustomConverter.cs Implementations/ChromaImplementation.cs Implementations/KeyboardImplementation.cs Implementations/MouseImplementation.cs Implementations/KeypadImplementation.cs Implementations/ChromaLinkImplementation.cs Implementations/MousepadImplementation.cs Implementations/HeadsetImplementation.cs Implementations/GenericDeviceImplementation.cs Implementations/DeviceImplementation.cs Rest/RestApi.cs Rest/RestException.cs Rest/Data/SdkInitResponse.cs Rest/Data/SdkResponse.cs Rest/Data/EffectData.cs Rest/Data/HeartbeatResponse.cs Rest/Data/SdkEffectResponse.cs Rest/Data/EffectGroup.cs Rest/RestClient.cs Rest/RestResponse.cs Helpers/RegistryHelper.cs Helpers/UriHelper.cs Helpers/ArrayHelper.cs Helpers/EnvironmentHelper.cs Helpers/TaskHelper.cs Api/ApiException.cs UnsupportedDeviceException.cs Events/ApplicationStateEventArgs.cs Events/SdkSupportEventArgs.cs Events/DeviceAccessEventArgs.cs ColoreException.cs ColoreProvider.cs

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.

Showing 51 of 73 files from the diff.

@@ -34,14 +34,14 @@
Loading
34 34
    /// <summary>
35 35
    /// Contains data for an effect to be sent to the REST API.
36 36
    /// </summary>
37 -
    internal struct EffectData
37 +
    internal readonly struct EffectData
38 38
    {
39 39
        /// <summary>
40 40
        /// Initializes a new instance of the <see cref="EffectData" /> structure.
41 41
        /// </summary>
42 42
        /// <param name="effect">Type of effect to create, should be a value from one of the <c>Effect</c> enumerations.</param>
43 43
        /// <param name="payload">Effect data, if applicable.</param>
44 -
        internal EffectData([NotNull] object effect, [CanBeNull] object payload = null)
44 +
        internal EffectData(object effect, object? payload = null)
45 45
        {
46 46
            Effect = effect ?? throw new ArgumentNullException(nameof(effect));
47 47
            Payload = payload;
@@ -50,18 +50,16 @@
Loading
50 50
        /// <summary>
51 51
        /// Gets the type of the effect.
52 52
        /// </summary>
53 -
        [NotNull]
54 53
        [JsonProperty("effect")]
55 54
        public object Effect { get; }
56 55
57 56
        /// <summary>
58 57
        /// Gets effect data, or <c>null</c> if not applicable for the current effect type.
59 58
        /// </summary>
60 -
        [CanBeNull]
61 59
        [JsonProperty(
62 60
            "param",
63 61
            DefaultValueHandling = DefaultValueHandling.Ignore,
64 62
            NullValueHandling = NullValueHandling.Ignore)]
65 -
        public object Payload { get; }
63 +
        public object? Payload { get; }
66 64
    }
67 65
}

@@ -49,12 +49,17 @@
Loading
49 49
        /// <param name="writer">The <see cref="JsonWriter" /> to write to.</param>
50 50
        /// <param name="value">The <see cref="CustomKeyboardEffect" /> value.</param>
51 51
        /// <param name="serializer">The calling serializer.</param>
52 -
        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
52 +
        public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
53 53
        {
54 +
            if (value is null)
55 +
            {
56 +
                writer.WriteNull();
57 +
58 +
                return;
59 +
            }
60 +
54 61
            var effect = (CustomKeyboardEffect)value;
55 -
#pragma warning disable SA1008 // Opening parenthesis must be spaced correctly
56 62
            var (colors, keys) = effect.ToMultiArrays();
57 -
#pragma warning restore SA1008 // Opening parenthesis must be spaced correctly
58 63
            var data = new EffectData(KeyboardEffectType.CustomKey, new { color = colors, key = keys });
59 64
            serializer.Serialize(writer, data);
60 65
        }
@@ -63,7 +68,7 @@
Loading
63 68
        public override object ReadJson(
64 69
            JsonReader reader,
65 70
            Type objectType,
66 -
            object existingValue,
71 +
            object? existingValue,
67 72
            JsonSerializer serializer)
68 73
        {
69 74
            throw new NotSupportedException("Only writing of Keyboard Custom objects is supported.");

@@ -49,8 +49,15 @@
Loading
49 49
        /// <param name="writer">The <see cref="JsonWriter" /> to write to.</param>
50 50
        /// <param name="value">The <see cref="StaticMousepadEffect" /> value.</param>
51 51
        /// <param name="serializer">The calling serializer.</param>
52 -
        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
52 +
        public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
53 53
        {
54 +
            if (value is null)
55 +
            {
56 +
                writer.WriteNull();
57 +
58 +
                return;
59 +
            }
60 +
54 61
            var effect = (StaticMousepadEffect)value;
55 62
            var data = new EffectData(MousepadEffectType.Static, effect.Color);
56 63
            serializer.Serialize(writer, data);
@@ -60,7 +67,7 @@
Loading
60 67
        public override object ReadJson(
61 68
            JsonReader reader,
62 69
            Type objectType,
63 -
            object existingValue,
70 +
            object? existingValue,
64 71
            JsonSerializer serializer)
65 72
        {
66 73
            throw new NotSupportedException("Only writing of mousepad Static objects is supported.");

@@ -170,7 +170,7 @@
Loading
170 170
        /// <param name="right">Right operand, an <see cref="object" />.</param>
171 171
        /// <returns><c>true</c> if the two instances are equal, <c>false</c> otherwise.</returns>
172 172
        [Pure]
173 -
        public static bool operator ==(Color left, object right)
173 +
        public static bool operator ==(Color left, object? right)
174 174
        {
175 175
            return left.Equals(right);
176 176
        }
@@ -182,7 +182,7 @@
Loading
182 182
        /// <param name="right">Right operand, an <see cref="object" />.</param>
183 183
        /// <returns><c>true</c> if the two instances are not equal, <c>false</c> otherwise.</returns>
184 184
        [Pure]
185 -
        public static bool operator !=(Color left, object right)
185 +
        public static bool operator !=(Color left, object? right)
186 186
        {
187 187
            return !left.Equals(right);
188 188
        }
@@ -223,7 +223,7 @@
Loading
223 223
        /// </summary>
224 224
        /// <param name="other">The <see cref="object" /> to check equality against.</param>
225 225
        /// <returns><c>true</c> if the two are equal, <c>false</c> otherwise.</returns>
226 -
        public override bool Equals(object other)
226 +
        public override bool Equals(object? other)
227 227
        {
228 228
            if (other is null)
229 229
                return false;

@@ -152,7 +152,7 @@
Loading
152 152
        /// <param name="left">The left operand, an instance of <see cref="DeathstalkerGridEffect" />.</param>
153 153
        /// <param name="right">The right operand, any type of object.</param>
154 154
        /// <returns><c>true</c> if the two objects are equal, otherwise <c>false</c>.</returns>
155 -
        public static bool operator ==(DeathstalkerGridEffect left, object right)
155 +
        public static bool operator ==(DeathstalkerGridEffect left, object? right)
156 156
        {
157 157
            return left.Equals(right);
158 158
        }
@@ -164,7 +164,7 @@
Loading
164 164
        /// <param name="left">The left operand, an instance of <see cref="DeathstalkerGridEffect" />.</param>
165 165
        /// <param name="right">The right operand, any type of object.</param>
166 166
        /// <returns><c>true</c> if the two objects are not equal, otherwise <c>false</c>.</returns>
167 -
        public static bool operator !=(DeathstalkerGridEffect left, object right)
167 +
        public static bool operator !=(DeathstalkerGridEffect left, object? right)
168 168
        {
169 169
            return !left.Equals(right);
170 170
        }
@@ -211,7 +211,7 @@
Loading
211 211
        /// and represent the same value; otherwise, <c>false</c>.
212 212
        /// </returns>
213 213
        /// <param name="obj">Another object to compare to. </param>
214 -
        public override bool Equals(object obj)
214 +
        public override bool Equals(object? obj)
215 215
        {
216 216
            if (obj is null)
217 217
                return false;

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Click to load this diff.
Loading diff...

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
src/Colore -2.36% 61.90%
Project Totals (75 files) 61.90%
Loading