Skip to content

Instantly share code, notes, and snippets.

@sakapon
Last active August 17, 2020 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sakapon/951a8f4b29347dbcdee1f77767ce1ff9 to your computer and use it in GitHub Desktop.
Save sakapon/951a8f4b29347dbcdee1f77767ce1ff9 to your computer and use it in GitHub Desktop.
OperatorsSample/ValueTupleTest.Sort
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTest.Structs
{
[TestClass]
public class ValueTupleTest
{
[TestMethod]
public void Sort()
{
var titles = new[]
{
("Book", 22),
("Book", 3),
("article", 111),
("Article", 22),
(null, -1),
("book", 111),
("article", 3),
};
Array.Sort(titles);
foreach (var (name, number) in titles)
Console.WriteLine($"{name} #{number}");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment