creae update devices
This commit is contained in:
@ -80,5 +80,27 @@ namespace Yuna.Tests.Repositories
|
||||
Assert.NotNull(result);
|
||||
Assert.True(result.All(x => x.UserId == 1));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Update_Updates()
|
||||
{
|
||||
//Arrange
|
||||
Settings.Init();
|
||||
var _context = new DapperContext(true);
|
||||
var repo = new DeviceRepository(_context);
|
||||
|
||||
//Act
|
||||
var initial = await repo.GetById(1);
|
||||
|
||||
initial!.Name += "1";
|
||||
var returnResult = await repo.Update(initial);
|
||||
|
||||
var realChanged = await repo.GetById(1);
|
||||
|
||||
|
||||
//Assert
|
||||
Assert.Equal(initial.Name, returnResult!.Name);
|
||||
Assert.Equal(initial!.Name, realChanged!.Name);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user