Example #1
0
        public async Task GetSaveDeleteUserAsync()
        {
            var dataReplyT = await _service.GetByIdAsync(1);

            Assert.AreEqual(DataReplyStatus.Ok, dataReplyT.Status);

            var user = dataReplyT.Data;

            user.Id    = 0;
            user.Login = $"{user.Login}a";
            user.Name  = $"{user.Name}a";
            user.Email = $"a{user.Email}";

            dataReplyT = await _service.SaveAsync(user);

            Assert.AreEqual(DataReplyStatus.Ok, dataReplyT.Status);

            user = dataReplyT.Data;

            Assert.IsNotNull(user);
            Assert.IsTrue(user.Id > 0);

            var dataReply = await _service.DeleteAsync(user.Id);

            Assert.AreEqual(DataReplyStatus.Ok, dataReply.Status);
        }