Exemple #1
0
 public void AccelerationModelAppearsPetrol()
 {
     m_model.NewGame();
     Assert.AreEqual(m_model.m_motorCycle.m_consumption, 1);
     Assert.AreEqual(m_model.m_motorCycle.m_petrolQuantity, 1000);
     Assert.AreEqual(m_model.m_petrolsList.Count, 0);
     m_model.NewPetrol(sizes, panelSize.m_y);
     Assert.AreEqual(m_model.m_petrolsList.Count, 1);
     m_model.NewPetrol(sizes, panelSize.m_y);
     Assert.AreEqual(m_model.m_petrolsList.Count, 2);
     m_model.NewPetrol(sizes, panelSize.m_y);
     Assert.AreEqual(m_model.m_petrolsList.Count, 3);
 }
Exemple #2
0
        public void Initialize()
        {
            m_mockedModel = new AccelerationGameModel(new AccelerationFileDataAccess(), panelSize, sizes, sizes);
            m_mockedModel.NewPetrol(sizes, 532);
            m_mockedModel.m_petrolsList[0].m_coordinates.m_x = 50;
            m_mockedModel.m_petrolsList[0].m_coordinates.m_y = 50;
            m_mockedModel.NewPetrol(sizes, 532);
            m_mockedModel.m_petrolsList[0].m_coordinates.m_x = 150;
            m_mockedModel.m_petrolsList[0].m_coordinates.m_y = 150;
            m_mockedModel.NewPetrol(sizes, 532);
            m_mockedModel.m_petrolsList[0].m_coordinates.m_x = 400;
            m_mockedModel.m_petrolsList[0].m_coordinates.m_y = 350;
            m_mock = new Mock <IAccelerationDataAccess>();
            m_mock.Setup(mock => mock.LoadAsync(It.IsAny <String>()))
            .Returns(() => Task.FromResult(m_mockedModel));


            m_model = new AccelerationGameModel(m_mock.Object, panelSize, sizes, sizes);
        }