Example #1
0
        public void AddMailingListItemViewModelTest()
        {
            var mlvmTest = new MailingListViewModel();


            var testList = new MailingList
            {
                Name             = "a",
                MailingListLines = new Collection <MailingListLine>
                {
                    new MailingListLine
                    {
                        Address = new Address
                        {
                            Email         = "*****@*****.**",
                            FirstName     = "yay",
                            LastName      = "demmetasdfadsf",
                            ReceivedMails = new List <ReceivedMail>()
                        }
                    }
                }
            };

            var mlivmTemp = new MailingListItemViewModel(testList, true);

            mlvmTest.AddMailingListItemViewModel(mlivmTemp);
            Assert.IsTrue(mlvmTest.MailingListItemViewModels.Contains(mlivmTemp));
        }
Example #2
0
        public void MessagePumpTest()
        {
            var mlvmTest = new MailingListViewModel();

            using (var db = new MailerEntities())
            {
                var mlist = new MailingList
                {
                    Name = "TestList"
                };
                db.MailingLists.Add(mlist);
                db.SaveChanges();


                var vm = new MailingListItemViewModel(mlist, true);
                mlvmTest.AddMailingListItemViewModel(vm);
                vm.Delete();

                Assert.IsFalse(mlvmTest.MailingListItemViewModels.Contains(vm));
            }
        }