private void createNet()
        {
            DataNetFactory.Parameter parameter = new DataNetFactory.Parameter(_creationData.Name);
            DataNet result = _dataNetFactory.Create(parameter);

            _dataNetContainer.Add(result);
        }
Ejemplo n.º 2
0
        public IEnumerator UserSelectsExistingNet()
        {
            yield return(Install());

            yield return(0);

            Assert.IsFalse(SceneManager.GetSceneByName(SceneNames.NetScene).isLoaded);
            DataNet firstNet = _netFactory.Create(new DataNetFactory.Parameter(_firstNetName));

            _container.Add(firstNet);
            yield return(0);

            NetSelectionElementsCreator _elementsCreator = GameObject.FindObjectOfType <NetSelectionElementsCreator>();

            Assert.AreEqual(1, _elementsCreator.ElementsCopy.Count);
            Assert.True(_elementsCreator.ElementsCopy.ContainsKey(firstNet.ID));
            NetSelectionElementInstaller element = _elementsCreator.ElementsCopy[firstNet.ID];
            Button button = element.GetComponentInChildren <Button>();

            button.onClick.Invoke();
            yield return(new WaitForSeconds(1));

            Assert.AreEqual(firstNet, _selectedNet.Selected);
            Assert.IsTrue(SceneManager.GetSceneByName(SceneNames.MainScene).isLoaded);
            Assert.IsTrue(SceneManager.GetSceneByName(SceneNames.NetScene).isLoaded);
            Assert.IsFalse(SceneManager.GetSceneByName(SceneNames.NetSelectionScene).isLoaded);
        }
        public void Create_ReturnsExpectedNet()
        {
            DataNet result = _factory.Create(_inputParameters);

            Assert.AreEqual(_inputParameters.ID, result.ID);
            Assert.AreEqual(_inputParameters.NetName, result.Name);
            Assert.AreEqual(result.NodeContainer.Count, 0);
        }