public async Task DeleteDomain()
        {
            var prev = db.Domains.Count();

            await service.DeleteDomain(new DeleteDomainRequest
            {
                DomainId = pku.Id.ToString(),
            }, TestContext);

            Assert.Equal(prev - 1, db.Domains.Count());
            // should be cascade delete
            Assert.Equal(1, db.Projects.Count());
        }
示例#2
0
        public object RemoveDomain(int id)
        {
            try
            {
                RedirectDomain domain = _ds.GetDomainById(id);

                if (domain == null)
                {
                    return(Request.CreateResponse(HttpStatusCode.NotFound, JsonMetaResponse.GetError(HttpStatusCode.NotFound, "The one that got away: The domain suffers from an ExistentialCrisisException")));
                }

                _ds.DeleteDomain(domain);

                return(JsonMetaResponse.GetSuccess("The domain is sleeping with the fishes"));
            }
            catch (Exception e)
            {
                return(JsonMetaResponse.GetError(HttpStatusCode.InternalServerError, e.ToString()));
            }
        }