コード例 #1
0
        public void Init()
        {
            db         = new NewsletterFormContext();
            controller = new SubscriptionController();

            testSubscriptionStandard = new Subscription()
            {
                EmailAddress = TEST_EMAIL,
                Source       = Source.Advert,
                Reason       = "I like your stuff",
                DateTime     = DateTime.Now
            };

            testSubscriptionMin = new Subscription()
            {
                EmailAddress = TEST_EMAIL,
                Source       = Source.WordOfMouth,
                DateTime     = DateTime.Now
            };

            testSubscriptionMax = new Subscription()
            {
                EmailAddress = TEST_EMAIL,
                Source       = Source.Other,
                SourceOther  = "I ended up visiting your website by chance when I was googling random stuff",
                Reason       = "Since I started reading your articles I cannot wait to read the next one",
                DateTime     = DateTime.Now
            };

            testSubscriptionLessThanMin = new Subscription()
            {
                EmailAddress = TEST_EMAIL
            };

            testSubscriptionEmpty = new Subscription();
        }