Last active
August 17, 2020 09:25
-
-
Save sakapon/951a8f4b29347dbcdee1f77767ce1ff9 to your computer and use it in GitHub Desktop.
OperatorsSample/ValueTupleTest.Sort
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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