mirror of
https://github.com/CommunityToolkit/dotnet.git
synced 2026-10-19 05:31:42 +08:00
e88c524c3e
Updated all unit tests to consistently use the expected value as the first argument in Assert.AreEqual calls. This improves readability and aligns with best practices for test assertions.
29 lines
698 B
C#
29 lines
698 B
C#
// Licensed to the .NET Foundation under one or more agreements.
|
|
// The .NET Foundation licenses this file to you under the MIT license.
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
#if NET8_0_OR_GREATER
|
|
|
|
using System.Runtime.CompilerServices;
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
namespace CommunityToolkit.HighPerformance.UnitTests;
|
|
|
|
[TestClass]
|
|
public class Test_RefOfT
|
|
{
|
|
[TestMethod]
|
|
public void Test_RefOfT_CreateRefOfT()
|
|
{
|
|
int value = 1;
|
|
Ref<int> reference = new(ref value);
|
|
|
|
Assert.IsTrue(Unsafe.AreSame(ref value, ref reference.Value));
|
|
|
|
reference.Value++;
|
|
|
|
Assert.AreEqual(2, value);
|
|
}
|
|
}
|
|
|
|
#endif |