Exemplo n.º 1
0
 public void Delete_should_delete_item_and_return_void()
 {
     var role = new Role("Admin") { Id = Guid.NewGuid().ToString("N") };
     Console.WriteLine($"New role - ID: {role.Id}, Name: {role.Name}");
     _context.Delete<Role>(role.Id);
 }
Exemplo n.º 2
0
 public void Update_should_change_value_and_return_Task()
 {
     var role = new Role("Admin") { Id = Guid.NewGuid().ToString("N") };
     Console.WriteLine($"New role - ID: {role.Id}, Name: {role.Name}");
     var action = _context.Update<Role>(role.Id, new KeyValuePair<string, object>("Name", "Subscriber"));
     Thread.Sleep(1000);
     action.ShouldBeOfType(typeof(Task));
     action.IsFaulted.ShouldBeFalse();
     action.IsCompleted.ShouldBeTrue();
 }