示例#1
0
        public void CreateTest()
        {
            this._context = this.InitContext().Result;
            ProcessorService ps = new ProcessorService(this._context);
            Processor        p  = new Processor()
            {
                id            = "0",
                name          = "test_processor",
                version       = "0.0.1",
                enabled       = true,
                description   = "test processor",
                file_type     = ".fake",
                process_found = 1
            };
            var p0     = ps.Create(p).Result;
            var result = this._context.Processors.SingleAsync(x => x.id == p.id).Result;

            Assert.NotNull(result);

            Processor p2 = new Processor();
            var       r2 = ps.Create(p2).Result;

            Assert.Null(r2.id);
        }