Ejemplo n.º 1
0
        public void FileChooserModel_GetDrivesExpectPassThrough()
        {
            //------------Setup for test--------------------------
            var qm = new Mock <IQueryManager>();

            qm.Setup(a => a.FetchFiles()).Returns(new List <IFileListing>()
            {
                new FileListing()
                {
                    Name = @"c:\"
                }, new FileListing()
                {
                    Name = @"d:\"
                }
            });
            var emailAttachmentModel = new FileChooserModel(qm.Object);

            //------------Execute Test---------------------------
            var drives = emailAttachmentModel.FetchDrives();

            //------------Assert Results-------------------------

            Assert.AreEqual(drives.Count, 2);
            Assert.AreEqual(drives[0].Name, @"c:\");
            Assert.AreEqual(drives[1].Name, @"d:\");
        }