Esempio n. 1
0
 public void Create_Successfully()
 {
     Result <Person> personResult = Create.From(Person.Create,
                                                Create.From(Name.Create,
                                                            FirstName.Create("John"),
                                                            LastName.Create("Miller")),
                                                EMail.Create("*****@*****.**"));
 }
Esempio n. 2
0
 public void Create_WithError()
 {
     Result <Person> personResult = Create.From(Person.Create,
                                                Create.From(Name.Create,
                                                            FirstName.Create("John"),
                                                            LastName.Create("Doe")),
                                                EMail.Create("*****@*****.**"));
 }
Esempio n. 3
0
        public ActionResult Create(CardVM cardvm)
        {
            Result <EMail> mailaddress = EMail.Create(cardvm.Email);
            Card           newcard     = new Card(cardvm.Id, cardvm.Name, cardvm.Company, cardvm.Telephone, cardvm.Notes, mailaddress.Value);

            newcard.ConvertVmToModel(cardvm);
            cardservice.CreateCard(newcard);
            cardservice.Save();
            return(View());
        }
Esempio n. 4
0
        private static List <Card> GetCards()
        {
            Result <EMail> MTResult  = EMail.Create("*****@*****.**");
            EMail          dummymail = MTResult.Value as EMail;

            return(new List <Card> {
                new Card {
                    Id = 1, Name = "Dummy", Company = "Test", Notes = "Test Notes Dummy", Telephone = "123456789", EMail = dummymail
                },
                new Card {
                    Id = 2, Name = "Hollywood", Company = "Test", Telephone = "123456789", Notes = "This is a test Hollywood Entity Note", EMail = dummymail
                },
                new Card {
                    Id = 3, Name = "Bugger", Company = "Test", Telephone = "123456789", Notes = "This is a test Bugger Entity Note", EMail = dummymail
                },
                new Card {
                    Id = 4, Name = "Yueming", Company = "Test", Telephone = "123456789", Notes = "This is a test Droppie Entity Note", EMail = dummymail
                },
                new Card {
                    Id = 5, Name = "Arrie", Company = "Test", Telephone = "123456789", Notes = "This is a test Arnold Entity Note", EMail = dummymail
                }
            });
        }