public void TestGroupWithoutPersons()
        {
            var model       = new PersonGroup("Group");
            var emailSender = new EmailSenderDummy();
            var viewModel   = new PersonGroupViewModel(model, emailSender);

            Assert.AreEqual(0, viewModel.Commands.Count, "incorrect commands count");
        }
Beispiel #2
0
        public void TestCaptionEmpty()
        {
            var emailSource = new EmailSourceStub("*****@*****.**");
            var model       = new Person("Name", emailSource);
            var emailSender = new EmailSenderDummy();
            var viewModel   = new PersonViewModel(model, emailSender);

            Assert.AreEqual("Name ([email protected])", viewModel.Caption, "incorrect person caption");
        }
        public void TestGroupWithOnePerson()
        {
            var model       = new PersonGroup("Group");
            var emailSource = new EmailSourceDummy();
            var person      = new Person("Person", emailSource);

            model.Persons.Add(person);

            var emailSender = new EmailSenderDummy();
            var viewModel   = new PersonGroupViewModel(model, emailSender);

            Assert.AreEqual(1, viewModel.Commands.Count, "incorrect commands count");
        }