コード例 #1
0
            public void ReturnsNotFoundWhenInstanceDoesNotExist()
            {
                service.When(x => x.Deprovision(Arg.Any <DeprovisionRequest>())).Do(x => { throw new InvalidOperationException(); });

                IHttpActionResult result = controller.Deprovision(Guid.NewGuid().ToString(), serviceId.ToString(), Guid.NewGuid().ToString());

                Assert.IsType <NotFoundResult>(result);
            }
コード例 #2
0
            public void ReturnsResourceConflictWhenUserAlreadyProvisioned()
            {
                service.When(x => x.RemoveBinding(Arg.Any <RemoveBindingRequest>())).Do(x => { throw new InvalidOperationException(); });

                IHttpActionResult result = controller.Unbind(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), serviceId.ToString(), Guid.NewGuid().ToString());

                Assert.IsType <NotFoundResult>(result);
            }
コード例 #3
0
            public void ReturnsResourceConflictWhenDatabaseAlreadyProvisioned()
            {
                service.When(x => x.Provision(Arg.Any <ProvisionRequest>())).Do(x => { throw new InvalidOperationException(); });

                IHttpActionResult result = controller.Provision(Guid.NewGuid().ToString(), new ProvisionRequest {
                    ServiceId = serviceId.ToString()
                });

                Assert.IsType <ConflictResult>(result);
            }