コード例 #1
0
        private MethodPacket BuildUpdateGroupsPacket(IEnumerable <MixPlayGroupModel> groups)
        {
            Validator.ValidateList(groups, "groups");
            MixPlayGroupCollectionModel collection = new MixPlayGroupCollectionModel()
            {
                groups = groups.ToList()
            };

            return(new MethodParamsPacket("updateGroups", JObject.FromObject(collection)));
        }
コード例 #2
0
        public void CreateGetUpdateDeleteGroup()
        {
            this.MixPlayWrapper(async(MixerConnection connection, MixPlayClient client) =>
            {
                MixPlayConnectedSceneModel testScene = await this.CreateScene(client);

                this.ClearPackets();

                MixPlayGroupModel testGroup = new MixPlayGroupModel()
                {
                    groupID = GroupID,
                    sceneID = testScene.sceneID
                };

                bool result = await client.CreateGroupsWithResponse(new List <MixPlayGroupModel>()
                {
                    testGroup
                });

                Assert.IsTrue(result);

                this.ClearPackets();

                MixPlayGroupCollectionModel groups = await client.GetGroups();

                Assert.IsNotNull(groups);
                Assert.IsNotNull(groups.groups);
                Assert.IsTrue(groups.groups.Count > 0);

                testGroup = groups.groups.FirstOrDefault(g => g.groupID.Equals(GroupID));
                MixPlayGroupModel defaultGroup = groups.groups.FirstOrDefault(g => g.groupID.Equals("default"));

                this.ClearPackets();

                groups = await client.UpdateGroupsWithResponse(new List <MixPlayGroupModel>()
                {
                    testGroup
                });

                Assert.IsNotNull(groups);
                Assert.IsNotNull(groups.groups);
                Assert.IsTrue(groups.groups.Count > 0);

                testGroup = groups.groups.FirstOrDefault(g => g.groupID.Equals(GroupID));

                this.ClearPackets();

                result = await client.DeleteGroupWithResponse(testGroup, defaultGroup);

                Assert.IsTrue(result);

                await this.DeleteScene(client, testScene);
            });
        }