public void Sort8() { var list = FList.New(3, 3, 4, 4, 3); var actual = FList.Sort(list, true); var expected = FList.New(4, 4, 3, 3, 3); Assert.AreEqual(expected, actual); }
public void Sort9() { var list = FList.New("Zoe", "Amy", "Ali", "Max", "Adi"); var actual = FList.Sort(list); var expected = FList.New("Adi", "Ali", "Amy", "Max", "Zoe"); Assert.AreEqual(expected, actual); }
public void Sort5() { var list = FList.Empty <int>(); var actual = FList.Sort(list); var expected = FList.Empty <int>(); Assert.AreEqual(expected, actual); }
public void Sort7() { var list = FList.New(1, 4, 6, 3, 2, 5); var actual = FList.Sort(list, true); var expected = FList.New(6, 5, 4, 3, 2, 1); Assert.AreEqual(expected, actual); }
public void Sort4() { var list = FList.New(3); var actual = FList.Sort(list); var expected = FList.New(3); Assert.AreEqual(expected, actual); }
public void Sort2() { var list = FList.New(1, 4, 6, 3, 2, 5); var actual = FList.Sort(list); var expected = FList.New(1, 2, 3, 4, 5, 6); Assert.AreEqual(expected, actual); }
public void Sort1String() { var list = "7146325"; var actual = FList.Sort(list); var expected = "1234567"; Assert.AreEqual(expected, actual.ToString()); }
private string GenerateMarkdown() { FList.Sort(); var baseUrl = "https://img.2222.moe/images/" + DateTime.UtcNow.AddHours(8).ToString("yyyy/MM/dd/"); var ret = new StringBuilder(); ret.AppendLine("Comparison (right click on the image and open it in a new tab to see the full-size one)"); ret.AppendLine("Source________________________________________________Encode"); ret.AppendLine(); foreach (var img in FList) { var src = baseUrl + img.SrcName; var rip = baseUrl + img.RipName; var tbl = baseUrl + img.FrameId + "s.png"; ret.AppendFormat("[![]({0})]({1}) [![]({0})]({2})", tbl, src, rip); ret.AppendLine(); } return(ret.ToString()); }
private string GenerateBbcode() { FList.Sort(); string url = "https://img.2222.moe/images/" + DateTime.UtcNow.AddHours(8).ToString("yyyy/MM/dd/"); var ret = new StringBuilder(); { ret.AppendLine("Comparison (right click on the image and open it in a new tab to see the full-size one)"); ret.AppendLine("Source________________________________________________Encode"); ret.AppendLine(); for (int i = 0; i < N; i++) { string src = url + FList[i].SrcName, rip = url + FList[i].RipName, tbl = url + FList[i].FrameId + "s.png"; ret.AppendFormat("[URL={1}][IMG]{0}[/IMG][/URL] [URL={2}][IMG]{0}[/IMG][/URL]", tbl, src, rip); ret.AppendLine(); } } return(ret.ToString()); }
private string GenerateHTML() { FList.Sort(); var baseUrl = "https://img.2222.moe/images/" + DateTime.UtcNow.AddHours(8).ToString("yyyy/MM/dd/"); var ret = new StringBuilder(); ret.Append("<p>"); ret.AppendLine("Comparison (right click on the image and open it in a new tab to see the full-size one)<br/>"); ret.AppendLine("Source________________________________________________Encode<br/></p>"); ret.AppendLine(); ret.Append("<p>"); foreach (var img in FList) { var src = baseUrl + img.SrcName; var rip = baseUrl + img.RipName; var tbl = baseUrl + img.FrameId + "s.png"; ret.AppendFormat("<a href=\"{1}\"><img src=\"{0}\"></a> <a href=\"{2}\"><img src=\"{0}\"></a><br/><br/>", tbl, src, rip); ret.AppendLine(); } ret.Append("</p>"); return(ret.ToString()); }
private void GenerateCode(bool show) { FList.Sort(); string path = Utility.CurrentDir + "url.txt"; string url = "http://img.2222.moe/images/" + DateTime.Today.ToString("yyyy/MM/dd/"); using (StreamWriter file = new StreamWriter(path, false)) { file.WriteLine("Comparison (right click on the image and open it in a new tab to see the full-size one)"); file.WriteLine("Source________________________________________________Encode"); file.WriteLine(); for (int i = 0; i < N; i++) { string src = url + FList[i].SrcName, rip = url + FList[i].RipName, tbl = url + FList[i].FrameId + "s.png"; file.WriteLine("[URL={1}][IMG]{0}[/IMG][/URL] [URL={2}][IMG]{0}[/IMG][/URL]", tbl, src, rip); } } if (show) { MessageBox.Show("截图代码已经写在url.txt里", "去丢发布组吧" + Utility.GetHappyEmotion()); } }
internal override void Sort() { FList.Sort(ColumnComparerMethod); FSorted = true; }