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);
        }
Exemplo n.º 3
0
        public void CreatedAt_is_set()
        {
            var operation = new NubeOperation();

            Assert.True(operation.CreatedAt > DateTimeOffset.Now.AddSeconds(-1));
        }
Exemplo n.º 4
0
        public void Id_is_generated()
        {
            var operation = new NubeOperation();

            Assert.NotEmpty(operation.Id);
        }
Exemplo n.º 5
0
 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));
 }