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); }
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); }
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); }