Exemplo n.º 1
0
        public void TestUpdateDataPayload()
        {
            List <Property>     _prop = new List <Property>();
            List <DataResponse> _data = new List <DataResponse>();

            TestCreateDataPayload();
            _data = DataPayload.Get();
            _prop.Add(new Property {
                key = "width", value = "200px"
            });
            DataResponse updateRecord = new DataResponse()
            {
                Id         = "Hello",
                Name       = "Hello.png",
                User       = "",
                Created_on = DateTime.Now.ToString(),
                Edited_on  = DateTime.Now.ToString(),
                Extension  = ".png",
                MimeType   = "application/image",
                Size       = 111,
                Type       = "IMAGE",
                Url        = "http://localhost/uploads/data/Hello.png",
                FilePath   = "",
                Properties = _prop
            };

            DataResponse updated = DataPayload.Update(updateRecord);

            Assert.NotEqual(_data[0].Properties, updateRecord.Properties);
        }
Exemplo n.º 2
0
        public void TestReadDataPayload()
        {
            List <DataResponse> _data = new List <DataResponse>();

            _data = DataPayload.Get();
            //Console.WriteLine(_data);
            Assert.NotNull(_data);
        }
Exemplo n.º 3
0
        public void TestDeleteDataPayload()
        {
            List <DataResponse> _model = new List <DataResponse>();

            TestCreateDataPayload();
            _model = DataPayload.Get();
            Assert.NotNull(_model);
            //
            bool isDeleted = DataPayload.Delete("HelloData");

            Assert.True(isDeleted);
            //
            _model = DataPayload.Get();
            Assert.True(_model.Count == 0);
        }
Exemplo n.º 4
0
 public ModelController(IHostingEnvironment environment, IConfiguration configuration, ILogger <ModelController> log, IPyNNServiceClient srv, IPyZMEServiceClient _zmeClient, IZSModelPredictionClient _zsClient, IPyTensorServiceClient tbClientInstance)
 {
     _environment       = environment ?? throw new ArgumentNullException(nameof(environment));
     this.Configuration = configuration;
     this.nnclient      = srv;
     this.Logger        = log;
     this.zmeClient     = _zmeClient;
     this.zsClient      = _zsClient;
     this.tbClient      = tbClientInstance;
     try
     {
         responseData     = ModelPayload.Get();
         dataResponseData = DataPayload.Get();
     }
     catch (Exception ex)
     {
         //ILogger
         string error = ex.Message;
     }
 }