示例#1
0
        public void TestCommandDataDispose() {
            var data = new CommandData() {
                Content = new List<String>(),
                Connections = new List<ConnectionModel>(),
                Groups = new List<Core.Shared.Models.GroupModel>(),
                Accounts = new List<AccountModel>(),
                Permissions = new List<PermissionModel>(),
                AccountPlayers = new List<AccountPlayerModel>(),
                Variables = new List<VariableModel>(),
                Languages = new List<LanguageModel>(),
                TextCommands = new List<TextCommandModel>(),
                TextCommandMatches = new List<TextCommandMatchModel>(),
                Chats = new List<ChatModel>(),
                Players = new List<PlayerModel>(),
                Kills = new List<KillModel>(),
                Spawns = new List<SpawnModel>(),
                Kicks = new List<KickModel>(),
                Bans = new List<BanModel>()
            };

            data.Dispose();

            Assert.IsNull(data.Content);
            Assert.IsNull(data.Connections);
            Assert.IsNull(data.Groups);
            Assert.IsNull(data.Accounts);
            Assert.IsNull(data.Permissions);
            Assert.IsNull(data.AccountPlayers);
            Assert.IsNull(data.Variables);
            Assert.IsNull(data.Languages);
            Assert.IsNull(data.TextCommands);
            Assert.IsNull(data.TextCommandMatches);
            Assert.IsNull(data.Chats);
            Assert.IsNull(data.Players);
            Assert.IsNull(data.Kills);
            Assert.IsNull(data.Spawns);
            Assert.IsNull(data.Kicks);
            Assert.IsNull(data.Bans);
        }