Esempio n. 1
0
        public void AlwaysHaveOnlyOneInstance()
        {
            PointsManager firstPointsManager  = PointsManager.GetInstance();
            PointsManager secondPointsManager = PointsManager.GetInstance();

            Assert.AreSame(firstPointsManager, secondPointsManager);
        }
Esempio n. 2
0
        public void HaveEmptyBlackListAnd150MoneyToPointsConversion()
        {
            PointsManager newPointsManager = PointsManager.GetInstance();

            Assert.AreEqual(150, newPointsManager.MoneyPerPoint);
            Assert.AreEqual(0, newPointsManager.Blacklist.Count);
        }
Esempio n. 3
0
    public void UpdatePositions(PointType removeAllFromType = PointType.None)
    {
        int       points = 0;
        PointType pt     = removeAllFromType;

        for (int i = 0; i < boardSize.y; i++)
        {
            for (int l = 0; l < boardSize.x; l++)
            {
                if (removeAllFromType != PointType.None)
                {
                    if (boardDots[i, l].GetComponent <InitializeDot>().dotType.pointType == removeAllFromType)
                    {
                        ProcessDot(i, l);
                        points++;
                    }
                }
                else if (!boardDots[i, l].activeSelf)
                {
                    pt = boardDots[i, l].GetComponent <InitializeDot>().dotType.pointType;
                    ProcessDot(i, l);
                    points++;
                }
            }
        }
        if (pt != PointType.None)
        {
            PointsManager.GetInstance().UpdatePoints(pt, points, levelGoal);
        }
    }
Esempio n. 4
0
        public void FailWithArgumentExceptionIfToBeRemovedBlacklistedProviderIsNotInBlacklist()
        {
            PointsManager newPointsManager = PointsManager.GetInstance();

            Provider newProvider = new Provider("Antel", 10, new List <IField>());

            newPointsManager.RemoveProviderFromBlacklist(newProvider);
        }
Esempio n. 5
0
        public void BeAbleToRemoveABlacklistedProvider()
        {
            PointsManager newPointsManager = PointsManager.GetInstance();

            Provider newProvider = new Provider("Antel", 10, new List <IField>());

            newPointsManager.AddProviderToBlacklist(newProvider);
            newPointsManager.RemoveProviderFromBlacklist(newProvider);

            Assert.AreEqual(0, newPointsManager.Blacklist.Count);
        }
Esempio n. 6
0
        public void BeAbleToAddPointsToClientIfProviderIsNotBlacklisted()
        {
            PointsManager newPointsManager    = PointsManager.GetInstance();
            Client        newClient           = new Client("Diego", "49018830", "26666666", "1112 28th NE");
            Provider      blacklistedProvider = new Provider("Antel", 10, new List <IField>());
            double        paidMoney           = 200;

            bool couldAdd = newPointsManager.AddPointsToClientIfProviderIsNotBlacklisted(
                paidMoney, newClient, blacklistedProvider);

            Assert.IsTrue(couldAdd);
        }
Esempio n. 7
0
        public void BeAbleToAddProvidersWithoutRepetitionToBlacklist()
        {
            PointsManager newPointsManager = PointsManager.GetInstance();

            Provider newProvider      = new Provider("Antel", 10, new List <IField>());
            Provider repeatedProvider = new Provider("Antel", 10, new List <IField>());

            newPointsManager.AddProviderToBlacklist(newProvider);
            newPointsManager.AddProviderToBlacklist(repeatedProvider);

            Assert.AreEqual(1, newPointsManager.Blacklist.Count);
        }
        private void AssignPointsManager()
        {
            PointsManager attemptedPointsManager = unitOfWork.PointsManagerRepository.GetByID(1);

            if (attemptedPointsManager == null)
            {
                attemptedPointsManager = PointsManager.GetInstance();
                unitOfWork.PointsManagerRepository.Insert(attemptedPointsManager);
                unitOfWork.Save();
            }
            pointsManager = attemptedPointsManager;
        }
Esempio n. 9
0
        public void FailWithArgumentExceptionIfToBeChangedMoneyPerPointIsNegative()
        {
            PointsManager newPointsManager = PointsManager.GetInstance();

            newPointsManager.ChangeMoneyPerPointRatio(-1);
        }