public async Task Throws_when_type_is_not_found() { var operation = new NubeOperation { Id = "1", TableName = "NonExistent" }; await Assert.ThrowsAsync <ReflectionTypeLoadException>(() => Service.ProcessOperationsAsync(Context, new List <NubeOperation> { operation })); }
public async Task Throws_when_type_is_not_found() { var operation = new NubeOperation { Id = "1", TableName = "NonExistent" }; var ex = await Assert.ThrowsAsync <NullReferenceException>(() => Service.ProcessOperationsAsync(Context, new List <NubeOperation> { operation })); Assert.Equal("The type NonExistent cannot be found", ex.Message); }
public void CreatedAt_is_set() { var operation = new NubeOperation(); Assert.True(operation.CreatedAt > DateTimeOffset.Now.AddSeconds(-1)); }
public void Id_is_generated() { var operation = new NubeOperation(); Assert.NotEmpty(operation.Id); }
private bool _DoesNotExist(DbContext context, NubeOperation operation) { return(context.Set <NubeServerOperation>().Find(operation.Id) == null); }
private bool _OperationExists(DbContext context, NubeOperation operation) { return(context.Set <NubeServerOperation>().Any(o => o.Id == operation.Id)); }