예제 #1
0
        public void SortSayingTest( )
        {
            GameSaying.LoadSayings( );
            GameSaying.Sayings.Sort((x, y) =>
            {
                int contentLenthDiff = x.ContentLenth - y.ContentLenth;
                if (contentLenthDiff == 0)
                {
                    int lenthDiff = x.ToXElement( ).ToString( ).Length - y.ToXElement( ).ToString( ).Length;
                    if (lenthDiff == 0)
                    {
                        return(string.CompareOrdinal(x.Content, y.Content));
                    }

                    return(lenthDiff);
                }

                return(contentLenthDiff);
            });
            string lastSaying = string.Empty;

            foreach (GameSaying saying in GameSaying.Sayings)
            {
                if (saying.Content != lastSaying)
                {
                    Console.WriteLine(saying.ToXElement( ));
                    lastSaying = saying.Content;
                }
            }
        }
예제 #2
0
파일: UnitTest.cs 프로젝트: GDxU/Richman4L
 public void LoadSayingTest( )
 {
     GameSaying.LoadSayings( );
 }