public void CreationIsOK() { bool test = false; var xdoc = XDocument.Parse(@"<Root> <Paylines name='BasePayLines'> <Payline name='line1' VerticalOffsets='1,1,1'/> <Payline name='line2' VerticalOffsets='1,1,1'/> </Paylines> <PayTable name='BasePayTable'> <Pay Amount='2500' ExactMatch='Queen,Queen,Ten'/> <Pay Amount='200' ExactMatch='Queen,Queen,King'/> </PayTable> </Root>"); var payMatchAmount = xdoc.Descendants("Pay").ToList <XElement>() .Select(xe => new PayMatchAmount(xe)) .ToList <PayMatchAmount>(); var payLineXML = xdoc.Descendants("Payline").ToList <XElement>() .Select(xe => new Payline(xe)) .ToList <IPayline>(); var slotEngine = new SlotEngine(payLineXML, payMatchAmount); if (slotEngine != null && slotEngine.PaylineList != null && slotEngine.PayMatchAmountList != null && slotEngine.PaylineList.Count == 2 && slotEngine.PayMatchAmountList.Count == 2) { test = true; } Assert.IsTrue(test); }
public void LoadDll(string sPath) { var dll = Assembly.LoadFrom(sPath);// string sName = dll.GetName().Name; Type type = dll.GetType(sName + "." + sName); object test = null; m_SlotEngine = Activator.CreateInstance(type) as SlotEngine; // m_SlotEngine = GetSlotType<t }
static void Main(string[] args) { Console.WriteLine("Hello World!"); // Just simple test var engine = new SlotEngine(); engine.EnterDeposit(200); engine.Stake = 20; var res = engine.Spin(); if (res.success) { if (200 - 20 + res.spin.Win != engine.GetBalance()) { throw new ApplicationException(); } } }
public void CalculateIsOk() { bool test = false; var payMatchA = new List <PayMatchAmount> { new PayMatchAmount(null, 0), new PayMatchAmount(null, 0) }; var payL = new List <IPayline> { new PayLineStub(new ReportDTO { HitTotal = 10, PayoffAmount = 300, PaylineHitTotal = 1, SpinTotal = 10 }), new PayLineStub(new ReportDTO { HitTotal = 10, PayoffAmount = 0, PaylineHitTotal = 0, SpinTotal = 10 }), new PayLineStub(new ReportDTO { HitTotal = 10, PayoffAmount = 100, PaylineHitTotal = 1, SpinTotal = 10 }) }; var slotEngine = new SlotEngine(payL, payMatchA); var dto = slotEngine.Calculate(null); if (dto.PayoffAmount == 800 && dto.SpinTotal == 1 && dto.PaylineHitTotal == 4 && dto.HitTotal == 1) { test = true; } Assert.IsTrue(test); }