Esempio n. 1
0
    public void ReadFile_StoresNames_Test()
    {
        List <PersonDetail> testList = new List <PersonDetail>();

        testList.Add(new PersonDetail {
            GivenName = "Jeff", LastName = "Bezos"
        });
        testList.Add(new PersonDetail {
            GivenName = "Bill", LastName = "Gates"
        });
        testList.Add(new PersonDetail {
            GivenName = "Elon", LastName = "Musk"
        });
        NameSorter nameSorter = new NameSorter();

        nameSorter.FileName = @"D:\CSharpPractice\GlobalX\unsorted-names-test.txt";

        nameSorter.ReadFile();

        testList.Should().BeEquivalentTo(nameSorter.GetNames());
    }