Ejemplo n.º 1
0
        public async void PostCannotAddPartnerWithSameEmailTest()
        {
            var controller = new PartnerController(partnerService, mapper, appSettings);
            var model      = new CreatePartnerViewModel()
            {
                Name = "Ikea",
            };

            var response = await controller.Post(model);

            var okResult = response as BadRequestObjectResult;

            Assert.NotNull(okResult);
            Assert.Equal(400, okResult.StatusCode);
            Assert.NotNull(okResult.Value);
        }
Ejemplo n.º 2
0
        public async void PostTest()
        {
            var controller = new PartnerController(partnerService, mapper, appSettings);
            var model      = new CreatePartnerViewModel()
            {
                Name = "Amazon1",
            };
            var response = await controller.Post(model);

            var okResult = response as OkObjectResult;

            Assert.NotNull(okResult);
            Assert.Equal(200, okResult.StatusCode);
            Assert.NotNull(okResult.Value);

            var partner = okResult.Value as Partner;

            Assert.Equal(model.Name, partner.Name);
        }
        public async Task TestCaseActivity_Success200()
        {
            var request = new List <CaseActivityRequest>()
            {
                new CaseActivityRequest()
                {
                    PartnerCaseNo    = "Partner0000001",
                    CaseNo           = "SF000001",
                    PartnerCaseType  = 1,
                    ParentCaseStatus = 4
                },
                new CaseActivityRequest()
                {
                    PartnerCaseNo    = "Partner0000002",
                    CaseNo           = "SF000002",
                    PartnerCaseType  = 2,
                    ParentCaseStatus = 5
                }
            };

            var response = await _controller.Post(request);

            Assert.IsInstanceOf <OkResult>(response);
        }