コード例 #1
0
        public JObject AddPI([FromBody] JObject newPi)
        {
            LogUrl();
            var pi = _jsonEditor.GetPi(newPi);

            var sendBack = _manage.AddPi(pi);

            return(sendBack);
        }
コード例 #2
0
ファイル: JsonTest.cs プロジェクト: ict-lab-teamrotjeknor/API
        public void GetPi()
        {
            var currentPi = JObject.Parse(
                @"{ 
                 'Id':'1234',
                 'MacAdress':'123:123:123:123',
                 'ClassroomName':'H.4.103'}"
                );

            var result = _json.GetPi(currentPi);

            var expected = new NewPI();

            expected.Id            = "1234";
            expected.MacAdress     = "123:123:123:123";
            expected.ClassroomName = "H.4.103";

            Assert.Equal(expected.Id, result.Id);
            Assert.Equal(expected.MacAdress, result.MacAdress);
            Assert.Equal(expected.ClassroomName, result.ClassroomName);
        }