/// <summary>
        /// The starting point of the application.
        /// </summary>
        static void Main()
        {
            // Create a new QuoteViewer object using the default
            // constructor, assign the object values using properties and
            // call a method.
            QuoteViewer qw = new QuoteViewer();

            qw.Quote = "I have a dream.";
            qw.Count = 7;
            qw.View();

            // Create and initiate another QuoteViewer object using
                        // constructor having two parameters and calls a method.
            QuoteViewer anotherQw =
                new QuoteViewer("Make love, not war.", 3);

            anotherQw.View();

            // Change the object data using a property and call a method.
            anotherQw.Quote = "Et tu, Brute";
            anotherQw.View();
        }
Example #2
0
        private void InitTest_ViewQuoteStep(out Quote quoteInstance, out QuoteViewer quoteViewerInstance, out ContactEditor2 contactEditorInstance, bool quoteViewerAgreeToTerms, bool isNewCustomer, string billType = null)
        {
            var quoteViewer  = new QuoteViewer();
            var currentDate  = DateTime.Now;
            var contact      = new Contact("salutation", "contactName", "title", "phone", "fax", "email", "address", "city", "state", "country", "zip");
            var customerName = "customerName";

            ShimCustomerBase.AllInstances.IsNewGet = (c) => isNewCustomer;
            var quote = new Quote(-1, new Customer());

            quote.BillType = billType;
            ShimQuoteApproval.AllInstances.CurrentQuoteGet = (q) => quote;
            ShimContactEditor2.AllInstances.IsTheSameAsBillingAddressGet = (ce) => true;
            ShimContactEditor2.AllInstances.IsTheSameAsTechContactGet    = (ce) => true;
            ShimContactEditor2.AllInstances.GetContact = (ce) => contact;
            ShimContactEditor2.AllInstances.CompanyGet = (ce) => customerName;
            var contactEditor = new ContactEditor2();

            contactEditor.Contact = contact;
            var userInfoEditor = new UserInfoCollector();

            ShimQuoteViewer.AllInstances.ContactEditorGet             = (qv) => contactEditor;
            ShimQuoteViewer.AllInstances.UserInfoEditorGet            = (qv) => userInfoEditor;
            ShimQuoteViewer.AllInstances.AgreeToTermsAndConditionsGet = (qv) => quoteViewerAgreeToTerms;
            ShimQuoteViewer.AllInstances.StartDateGet  = (qv) => currentDate;
            ShimControl.AllInstances.FindControlString = (c, id) =>
            {
                if (id == "uclQuoteViewer")
                {
                    return(quoteViewer);
                }
                return(null);
            };
            quoteInstance         = quote;
            contactEditorInstance = contactEditor;
            quoteViewerInstance   = quoteViewer;
        }