Example #1
0
        public void TestProposalSubmitted()
        {
            DoneByMe.Matching.Infra.StartUp.Start();
            DoneByMe.Pricing.Infra.StartUp.Start();

            Client client = Client.From("12345");

            ISet <Step> steps = new HashSet <Step>();

            steps.Add(Step.Ordered(1, Description.Has("Step 1")));

            Expectations expectations =
                Expectations.Of(
                    Summary.Has("A summary"),
                    Description.Has("A description"),
                    new DateTime(DateTime.Now.Ticks + (24 * 60 * 60 * 1000)),
                    steps,
                    1995);

            Proposal proposal = Proposal.SubmitFor(client, expectations);

            Repositories.ProposalRepository.Save(proposal);

            Thread.Sleep(1000);
        }
Example #2
0
        public void Submit(string studentId, string summary, string description, string language,
                           DateTime startDate, DateTime?endDate, List <DayOfWeek> schedule)
        {
            var proposal = Proposal.SubmitFor(Id.Unique(), new Student(studentId),
                                              Expectations.Of(summary, description, language,
                                                              LessonSchedule.With(startDate, endDate, schedule)));

            _repository.Save(proposal);
        }
Example #3
0
        public void TestProposalSubmitted()
        {
            DoneByMe.Matching.Infra.StartUp.Start();
            DoneByMe.Pricing.Infra.StartUp.Start();

            Client client = Client.From("12345");

            ISet <Step> steps = new HashSet <Step>();

            steps.Add(Step.Ordered(1, Description.Has("Step 1")));

            ISet <string> keywords = new HashSet <string> {
                "#windows"
            };

            Expectations expectations =
                Expectations.Of(
                    Summary.Has("A summary"),
                    Description.Has("A description"),
                    new DateTime(DateTime.Now.Ticks + (24 * 60 * 60 * 1000)),
                    steps,
                    1995,
                    keywords);

            Proposal proposal = Proposal.SubmitFor(client, expectations);

            Repositories.ProposalRepository.Save(proposal);

            Proposal existing = Repositories.ProposalRepository.ProposalOf(proposal.Id);

            Console.WriteLine("PRICING DENIED: " + existing.Progress.WasPricingDenied());

            Assert.IsNotNull(existing);

            Thread.Sleep(1000);

            existing = Repositories.ProposalRepository.ProposalOf(proposal.Id);

            Assert.IsTrue(existing.Progress.WasPricingVerified());
        }
        public void SubmitProposal(
            string clientId,
            string summary,
            string description,
            DateTime completedBy,
            Dictionary <int, string> steps,
            long price,
            ISet <string> keywords)
        {
            Proposal proposal =
                Proposal.SubmitFor(
                    Client.From(clientId),
                    Expectations.Of(
                        Summary.Has(summary),
                        Description.Has(description),
                        completedBy,
                        Step.From(steps),
                        price,
                        keywords));

            repository.Save(proposal);
        }