Esempio n. 1
0
        public async Task SceneCRUDTest()
        {
            Scene test = new Scene();

            test.Name   = "scene1";
            test.Lights = new List <string> {
                "2"
            };

            var result = await _client.CreateSceneAsync(test);

            Assert.IsNotNull(result);

            //Get scene
            var newScene = await _client.GetSceneAsync(result);

            Assert.IsNotNull(newScene);

            var firstState = newScene.LightStates.First();

            firstState.Value.On = false;

            var modifyResult = await _client.UpdateSceneAsync(result, newScene);

            //Delete scene
            var deleteResult = await _client.DeleteSceneAsync(result);

            Assert.IsTrue(deleteResult.Any());

            var deletedScene = await _client.GetSceneAsync(result);

            Assert.IsNull(deletedScene);
        }
Esempio n. 2
0
        public async Task SceneCRUDTest()
        {
            Scene test = new Scene();

            test.Name   = "scene1";
            test.Lights = new List <string> {
                "2"
            };

            var result = await _client.CreateSceneAsync(test);

            Assert.IsNotNull(result);

            //Get scene
            var newScene = await _client.GetSceneAsync(result);

            Assert.IsNotNull(newScene);

            //Delete scene
            var deleteResult = await _client.DeleteSceneAsync(result);

            Assert.IsTrue(deleteResult.Any());

            var deletedScene = await _client.GetSceneAsync(result);

            Assert.IsNull(deletedScene);
        }
Esempio n. 3
0
        public async Task Create()
        {
            Scene test = new Scene();

            test.Name   = "scene1";
            test.Lights = new List <string> {
                "2"
            };

            var result = await _client.CreateSceneAsync(test);

            Assert.IsNotNull(result);
        }