Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
#if !WINDOWS_UWP

using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using Microsoft.Toolkit.HighPerformance.Enumerables;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace UnitTests.HighPerformance.Enumerables
{
[TestClass]
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649", Justification = "Test class for generic type")]
public class Test_ReadOnlyRefEnumerable
{
[TestCategory("ReadOnlyRefEnumerable")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
#if !WINDOWS_UWP

using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using Microsoft.Toolkit.HighPerformance.Enumerables;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace UnitTests.HighPerformance.Enumerables
{
[TestClass]
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649", Justification = "Test class for generic type")]
public class Test_RefEnumerable
{
[TestCategory("RefEnumerable")]
Expand Down
4 changes: 2 additions & 2 deletions UnitTests/UnitTests.NetCore/Mvvm/Test_ICommandAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#pragma warning disable CS0618

using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.Input;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace UnitTests.Mvvm
{
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1601", Justification = "Type only used for testing")]
[TestClass]
public partial class Test_ICommandAttribute
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
// See the LICENSE file in the project root for more information.

using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace UnitTests.Mvvm
{
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1601", Justification = "Type only used for testing")]
[TestClass]
public partial class Test_INotifyPropertyChangedAttribute
{
Expand Down
2 changes: 2 additions & 0 deletions UnitTests/UnitTests.NetCore/Mvvm/Test_IRecipientGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
#pragma warning disable CS0618

using System;
using System.Diagnostics.CodeAnalysis;
using Microsoft.Toolkit.Mvvm.Messaging;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace UnitTests.Mvvm
{
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1601", Justification = "Type only used for testing")]
[TestClass]
public partial class Test_IRecipientGenerator
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
// See the LICENSE file in the project root for more information.

using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace UnitTests.Mvvm
{
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1601", Justification = "Type only used for testing")]
[TestClass]
public partial class Test_ObservableObjectAttribute
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.VisualStudio.TestTools.UnitTesting;
Expand All @@ -14,6 +15,7 @@

namespace UnitTests.Mvvm
{
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1601", Justification = "Type only used for testing")]
[TestClass]
public partial class Test_ObservablePropertyAttribute
{
Expand Down Expand Up @@ -105,9 +107,10 @@ public void Test_ValidationAttributes()
Assert.AreEqual(testAttribute.D, 6.28);
CollectionAssert.AreEqual(testAttribute.Names, new[] { "Bob", "Ross" });

object[] nestedArray = (object[])testAttribute.NestedArray;
object[]? nestedArray = (object[]?)testAttribute.NestedArray;

Assert.AreEqual(nestedArray.Length, 3);
Assert.IsNotNull(nestedArray);
Assert.AreEqual(nestedArray!.Length, 3);
Assert.AreEqual(nestedArray[0], 1);
Assert.AreEqual(nestedArray[1], "Hello");
Assert.IsTrue(nestedArray[2] is int[]);
Expand Down Expand Up @@ -181,7 +184,7 @@ public TestValidationAttribute(object? o, Type t, bool flag, double d, string[]

public string[] Names { get; }

public object NestedArray { get; set; }
public object? NestedArray { get; set; }

public Animal Animal { get; set; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using Microsoft.Toolkit.Mvvm.ComponentModel;
Expand All @@ -13,6 +14,7 @@

namespace UnitTests.Mvvm
{
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1601", Justification = "Type only used for testing")]
[TestClass]
public partial class Test_ObservableRecipientAttribute
{
Expand Down
2 changes: 2 additions & 0 deletions UnitTests/UnitTests.Shared/Mvvm/Test_Messenger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
// See the LICENSE file in the project root for more information.

using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using Microsoft.Toolkit.Mvvm.Messaging;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace UnitTests.Mvvm
{
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1601", Justification = "Type only used for testing")]
[TestClass]
public partial class Test_Messenger
{
Expand Down