view Tests.lua @ 15:9e61a930b822

Modified the Model model for additional filters and subqueries
author wobin
date Sat, 25 Apr 2009 21:42:27 +1000
parents 2231fd3f139b
children
line wrap: on
line source
-- Tests for Squawk

if not Squawk then return end

--[[
--Tests we need to do:
--
--  Add a follower
--  Remove a follower
--  Request to follow someone
--  Recieve a request from a follower
--  Send a Squawk 
--  Recieve a direct Squawk
--  Send a Squawk to the Guild
--  Recieve a Squawk from the Guild
--]]
--

SquawkTester = LibStub("AceAddon-3.0"):NewAddon("SquawkTester", "AceComm-3.0", "AceConsole-3.0")

local Test = SquawkTester
local Controller = Squawk.Controller
local Settings = Squawk.Model.UserSettings

function Test:OnInitialize()
	self:RegisterComm("Squawk", "ReceiveMessage")
	self:RegisterChatCommand("TS", "RunTests")
	self:Print("Initialising Tester")

	self.Tests = { ["a"] = SquawkTester.AddPublicFollower,
								["b"] = SquawkTester.RemovePublicFollower,
								["c"] = SquawkTester.AddPrivateFollower,
								["d"] = SquawkTester.ApprovePendingRequest
							}
end
function Test:RunTests(TestNumber)
	self:Print(TestNumber)
	self.Tests[TestNumber](Test)
end

function Test:AddPublicFollower()
	Settings:TogglePrivate()
	Controller:IWantToFollowThem(UnitName("player"))
end

function Test:RemovePublicFollower()
	Controller:IWantToUnfollowThem(UnitName("player"))
end

function Test:AddPrivateFollower()
	Settings:TogglePrivate()
	Controller:IWantToFollowThem(UnitName("player"))
end

function Test:ApprovePendingRequest()
	Controller:ApprovePendingRequest(UnitName("player"))
end

function Test:ReceiveMessage(Prefix, Message, Distribution, Sender)
end

function Test:SendMessageDirectly(Message)
	
end