public void CreateOpportunity()
        {
            var generator = new StringGenerator();

            var person = new Person()
            {
                id        = "60275159",
                firstName = "Ola",
                lastName  = "Nordmann"
            };


            var opportunity = new OpportunityToCreate()
            {
                opportunity = new Opportunity()
                {
                    currency      = "NOK",
                    milestoneId   = "239401",
                    name          = string.Format("Intouch demo for {0} - {1} {2}", person.organisationName, person.firstName, person.lastName),
                    durationBasis = "FIXED"
                }
            };

            var newOpportunity = opportunityService.Create(person.id, opportunity);

            newOpportunity.id.ShouldBeGreaterThan("2175534");
            newOpportunity.currency.ShouldEqual("NOK");
            newOpportunity.name.ShouldContain("Intouch demo for ");
        }
Exemplo n.º 2
0
        public Opportunity Create(string PartyId, OpportunityToCreate opportunity)
        {
            log.InfoFormat("Creating opportunity for party: {0} ", opportunity.opportunity.id);
            var request = new RestRequest(String.Format("/api/party/{0}/opportunity", PartyId), Method.POST);

            request.RequestFormat = DataFormat.Json;
            request.RootElement   = "opportunity";
            request.AddBody(opportunity);

            return(CreateExecute <Opportunity>(request));
        }