Ejemplo n.º 1
0
 void CheckForTrue(int itemNumber, string folderName, string fileEnding)
 {
     if (menuItems[itemNumber] == true)
     {
         TidyUp.TidyUpFolder(folderName, fileEnding);
     }
 }
Ejemplo n.º 2
0
        public void GivenWeHaveTheFollowingExistingEntries(Table table)
        {
            var tableSerialized = new SerializableTable(table);

            Deleporter.Run(() =>
            {
                var originalRepository = IoC.CurrentGuestbookEntryRepository;
                TidyUp.AddTask(() => { IoC.CurrentGuestbookEntryRepository = originalRepository; });

                var mockRepository = new Mock <IGuestbookEntryRepository>();
                mockRepository.Setup(x => x.Entries)
                .Returns((from row in tableSerialized.Rows
                          select new GuestbookEntry
                {
                    Author = row["Name"],
                    Comment = row["Comment"],
                    PostedDate = Convert.ToDateTime(row["Posted date"])
                }).AsQueryable());

                IoC.CurrentGuestbookEntryRepository = mockRepository.Object;
            });
        }