示例#1
0
        public async Task GetAllExistingUsersInRepository()
        {
            var users = (await UserMocks.UsersMock()).OrderBy(i => i.Id).ToList();

            await _repository.CreateItemsAsync(users);

            var savedUsers = (await _repository.GetItemsAsync(i => i.Id != 0)).OrderBy(i => i.Id).ToList();

            Assert.Equal(users, savedUsers);

            var serializedUsers      = JsonConvert.SerializeObject(users);
            var serializedSavedUsers = JsonConvert.SerializeObject(savedUsers);

            Assert.Equal(serializedUsers, serializedSavedUsers);
        }