Example #1
0
 public void CheckIfCapacityPropertyThrowsExceptions()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         RobotManager robotManager = new RobotManager(-2);
     });
 }
        public void ConstructorShouldWorkProperly()
        {
            // var robot = new Robot("Alex", 100);
            var robotManager = new RobotManager(100);

            Assert.AreEqual(100, robotManager.Capacity);
        }
Example #3
0
 public void CapacityShouldThrowExceptionWhenValueIsBelowZero()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         RobotManager robotManager = new RobotManager(-5);
     });
 }
Example #4
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
 }
Example #5
0
 public void WhenRobotManagerCreated_CountShouldBeZero()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         RobotManager robManager = new RobotManager(-4);
     });
 }
Example #6
0
 public void CheckWheterCapacityThrowsExceptionIfValueIsNegativeNumber()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         robotManager = new RobotManager(-1);
     });
 }
Example #7
0
 public void WhenRobotManagerCapacityIsNegative_CapacityExeptionShouldBeThrown()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         RobotManager robomanager = new RobotManager(-5);
     });
 }
        public void ShouldThrowWhenRemovingNonExistentRobot()
        {
            var robotManager = new RobotManager(1);

            Assert
            .Throws <InvalidOperationException>(() => robotManager.Remove("apu"));
        }
Example #9
0
        private static void Postfix()
        {
            if (!GameplayManager.IsDedicatedServer())
            {
                return;
            }
            Debug.Log("MPTweaksLoadScene");
            RobotManager.ReadMultiplayerModeFile();
            Debug.Log("MPTweaks loaded mode file");
            var tweaks = new Dictionary <string, string>()
            {
            };

            if (NetworkMatch.GetMode() == CTF.MatchModeCTF)
            {
                tweaks.Add("ctf.returntimer", CTF.ReturnTimeAmountDefault.ToStringInvariantCulture());
            }
            if (!MPCustomModeFile.PickupCheck)
            {
                tweaks.Add("item.pickupcheck", Boolean.FalseString);
            }
            tweaks.Add("nocompress.reliable_timestamps", Boolean.TrueString);
            if (tweaks.Any())
            {
                Debug.LogFormat("MPTweaks: sending tweaks {0}", tweaks.Join());
                MPTweaks.Set(tweaks);
                MPTweaks.Send();
            }
        }
Example #10
0
 public void RobotManagerCapacityMustThrowExceptionIfValueIsBelowZero()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         RobotManager manager = new RobotManager(-1);
     });
 }
Example #11
0
        public void Setup()
        {
            robot1 = new Robot("Pesho", 100);
            robot2 = new Robot("Gosho", 200);

            manager = new RobotManager(2);
        }
Example #12
0
        public void AddCannotAddIfCapacityFull()
        {
            this.manager = new RobotManager(capacityWithValueOne);
            this.manager.Add(robotOne);

            Assert.Throws <InvalidOperationException>(() => this.manager.Add(this.robotTwo));
        }
 public void CapacityShouldThrownExceptionWithNegativeValue(int capacity)
 {
     Assert.Throws <ArgumentException>(() =>
     {
         this.robotManager = new RobotManager(capacity);
     });
 }
 public void RobotsCapacityShouldThrowsExceptionWhenIsBelowZero(int capacity)
 {
     Assert.Throws <ArgumentException>(() =>
     {
         RobotManager manager = new RobotManager(capacity);
     });
 }
Example #15
0
        public void ConstructorCreateCorrectly()
        {
            this.EmptyManager = new RobotManager(capacity);

            Assert.That(this.manager, Is.Not.Null, "Constructor not correct");
            Assert.That(this.manager.Capacity, Is.EqualTo(capacity), "Constructor not correct");
        }
Example #16
0
        public void WorkShouldThrowExceptionWhenIsNameNotFound()
        {
            var robotManager = new RobotManager(10);

            Assert.Throws <InvalidOperationException>(()
                                                      => robotManager.Work("None", "Job", 5));
        }
Example #17
0
        public void RemoveRobotShouldThrowExceptionWhenRobotIsNull()
        {
            var robotManager = new RobotManager(10);

            Assert.Throws <InvalidOperationException>(()
                                                      => robotManager.Remove("RoboTest"));
        }
Example #18
0
        public void ChargeShouldThrowExceptionWhenRobotIsNotFound()
        {
            var robotManager = new RobotManager(10);

            Assert.Throws <InvalidOperationException>(()
                                                      => robotManager.Charge("TestName"));
        }
Example #19
0
        public void Add_NotEnoughCapacity()
        {
            robotManager = new RobotManager(1);
            robotManager.Add(new Robot("Gosho", 5));

            Assert.That(() => robotManager.Add(new Robot("Pesho", 6)), Throws.InvalidOperationException);
        }
Example #20
0
        public void RobotManagerConstructorWorksCorrectly()
        {
            int capacity     = 14;
            var robotManager = new RobotManager(14);

            Assert.That(capacity, Is.EqualTo(robotManager.Capacity));
        }
 public void ConstructorShouldThrowExceptionWithNegativeCapacity()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         RobotManager manager = new RobotManager(-10);
     });
 }
Example #22
0
        public void CannotAddRobotWhenCapacityIsFull()
        {
            var robotmanager = new RobotManager(0);

            Assert.That(() => robotmanager.Add(Robot1),
                        Throws.InstanceOf <InvalidOperationException>());
        }
Example #23
0
        public void AddRobot_ThrowException()
        {
            RobotManager rm = new RobotManager(10);

            rm.Add(robot);
            Assert.Throws <InvalidOperationException>(() => rm.Add(robot));
        }
Example #24
0
        public void RobotManagerConstructorShouldInitializeCorrectValue()
        {
            RobotManager robotManager = new RobotManager(1);

            Assert.AreEqual(1, robotManager.Capacity);
            Assert.AreEqual(0, robotManager.Count);
        }
Example #25
0
    // Use this for initialization
    void Start()
    {
        tutorialState    = "";
        currentState     = "";
        moveButton       = GameObject.Find("MoveButton");
        lightButton      = GameObject.Find("LightButton");
        proximityButton  = GameObject.Find("ProximityButton");
        soundButton      = GameObject.Find("SoundButton");
        returnButton     = GameObject.Find("ReturnButton");
        menuButton       = GameObject.Find("MenuButton");
        conceptCanvas    = GameObject.Find("ConceptCanvas").GetComponent <Canvas>();
        tutorialCanvas   = GameObject.Find("TutorialCanvas").GetComponent <Canvas>();
        locomotionCanvas = GameObject.Find("LocomotionCanvas").GetComponent <Canvas>();
        environment      = GameObject.Find("Environment");
        robotManager     = GameObject.Find("RobotManager").GetComponent <RobotManager>();

        environment.SetActive(false);
        returnButton.SetActive(false);
        //robotController.enabled = false;
        tutorialCanvas.enabled   = false;
        locomotionCanvas.enabled = false;

        obstaclesTutorial.SetActive(false);
        otIRAnatomy.SetActive(false);
        otIRFunctionality.SetActive(false);
        otTask.SetActive(false);
    }
Example #26
0
 public void DoesNegativeCapacityThrowException()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         robotManager = new RobotManager(-5);
     });
 }
Example #27
0
 public void ExceptionIsThrown_WhenRobotManagerHasNegativeCapacity()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         RobotManager wrongManager = new RobotManager(-10);
     });
 }
Example #28
0
 public void InvalidCapacityShouldThrowExceptionWhenNegative()
 {
     Assert.That(() =>
     {
         var robotManager = new RobotManager(-5);
     }, Throws.ArgumentException);
 }
Example #29
0
 public void WhenRobotManagerCapacityIsNegative_CapacityShoudThrowException()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         RobotManager roboManager = new RobotManager(-5);
     });
 }
Example #30
0
        public frmMain()
        {
            InitializeComponent();
            RegisterEvents();

            robotManager = new RobotManager();
        }
Example #31
0
    // Use this for initialization
    void Start () {
        m_gameManager = GameManager.Instance;
        m_robotManager = m_gameManager.m_RobotPrefab.GetComponent<RobotManager>();

        m_canvas = GetComponent<Canvas>();
        m_healthSlider = m_canvas.transform.GetChild(0).GetChild(0).GetComponent<Slider>();
        m_scoreText = m_canvas.transform.GetChild(1).GetChild(0).GetComponent<Text>();
        m_timeText = m_canvas.transform.GetChild(1).GetChild(1).GetComponent<Text>();
    }
Example #32
0
        private static void client_MqttMsgPublishReceived(object sender, MqttMsgPublishEventArgs e)
        {
            if (e.Topic == "/RXAUTH")
            {
                string newSerial = Encoding.UTF8.GetString(e.Message);
                var robot = new RobotManager(newSerial);
                if (Robots == null)
                    Robots = new List<RobotManager>();
                Robots.Add(robot);
            }

            Console.WriteLine(e.Topic + " : " + Encoding.UTF8.GetString(e.Message));
        }
Example #33
0
 void GameManager_OnMatchStart( )
 {
     m_robotManager = GameManager.Instance.m_Player.GetComponent<RobotManager>( );
 }