Example #1
0
        public void AcceptEndpointAndObject()
        {
            var message = EveClient.DeleteAsync(Endpoint, Original).Result;

            Assert.AreEqual(HttpStatusCode.NoContent, message.StatusCode);

            // confirm that item has been deleted on remote
            message = EveClient.GetAsync(string.Format("{0}/{1}", Endpoint, Original.UniqueId)).Result;
            Assert.AreEqual(HttpStatusCode.NotFound, message.StatusCode);
        }
Example #2
0
        public void DeleteEndpointContent()
        {
            var message = EveClient.DeleteAsync(Endpoint).Result;

            Assert.AreEqual(HttpStatusCode.NoContent, message.StatusCode);

            // confirm that item has been deleted on remote
            var companies = EveClient.GetAsync <Company>(Endpoint).Result;

            Assert.AreEqual(HttpStatusCode.NoContent, message.StatusCode);
            Assert.AreEqual(0, companies.Count);
        }
Example #3
0
        public void AcceptEndpointConsiderImsAndSoftDeleteAndQuery()
        {
            System.Threading.Thread.Sleep(1000);

            var rawQuery = @"{""name"": ""Name2""}";
            var result   = EveClient.GetAsync <Company>(Endpoint, null, rawQuery: rawQuery).Result;

            Assert.AreEqual(HttpStatusCode.OK, EveClient.HttpResponse.StatusCode);
            Assert.AreEqual(result.Count, 1);

            var original3 = EveClient.PostAsync <Company>(Endpoint, new Company {
                Name = "Name3"
            }).Result;

            Assert.AreEqual(HttpStatusCode.Created, EveClient.HttpResponse.StatusCode);

            rawQuery = @"{""name"": ""Name3""}";
            result   = EveClient.GetAsync <Company>(Endpoint, null, rawQuery: rawQuery).Result;
            Assert.AreEqual(HttpStatusCode.OK, EveClient.HttpResponse.StatusCode);
            Assert.AreEqual(result.Count, 1);

            result = EveClient.GetAsync <Company>(Endpoint, original3.Updated, rawQuery).Result;
            Assert.AreEqual(HttpStatusCode.OK, EveClient.HttpResponse.StatusCode);
            Assert.AreEqual(result.Count, 0);

            result = EveClient.GetAsync <Company>(Endpoint, Original2.Updated, rawQuery).Result;
            Assert.AreEqual(HttpStatusCode.OK, EveClient.HttpResponse.StatusCode);
            Assert.AreEqual(result.Count, 1);

            var r = EveClient.DeleteAsync(Endpoint, original3).Result;

            Assert.AreEqual(HttpStatusCode.NoContent, r.StatusCode);

            result = EveClient.GetAsync <Company>(Endpoint, Original2.Updated, true).Result;
            Assert.AreEqual(HttpStatusCode.OK, EveClient.HttpResponse.StatusCode);
            Assert.AreEqual(1, result.Count);
            Assert.IsTrue(result[0].Deleted);
        }
Example #4
0
 public async Task ResourceArgumentNameNullException()
 {
     await EveClient.DeleteAsync(null, Original);
 }
Example #5
0
 public async Task BaseAddressPropertyNullExceptionAlt()
 {
     EveClient.BaseAddress  = null;
     EveClient.ResourceName = "resource";
     await EveClient.DeleteAsync(Original);
 }
Example #6
0
 public async Task BaseAddressPropertyNullException()
 {
     EveClient.BaseAddress = null;
     await EveClient.DeleteAsync("resource", Original);
 }
Example #7
0
 public async Task ResourceNamePropertyNullException()
 {
     await EveClient.DeleteAsync(Original);
 }
Example #8
0
 public async Task ObjArgumentNullException()
 {
     await EveClient.DeleteAsync("resource", null);
 }
Example #9
0
 public async Task ResourceNameArgumentException()
 {
     await EveClient.DeleteAsync(string.Empty, Original);
 }
Example #10
0
 public async Task ObjArgumentNullExceptionAlt()
 {
     EveClient.ResourceName = "resource";
     await EveClient.DeleteAsync(null);
 }