Beispiel #1
0
        public void GetModel_ValueSameAs_AddModel()
        {
            // Arrange
            ModelLocator modelLocator = new ModelLocator();
            TestModel    testModel    = new TestModel();

            // Act
            modelLocator.AddModel(testModel);
            TestModel foundTestModel = modelLocator.GetModel <TestModel>();

            // Assert
            Assert.That(foundTestModel, Is.SameAs(testModel));
        }
Beispiel #2
0
        public void GetModel_ValueSameAs_AddModel()
        {
            // Arrange
            ModelLocator modelLocator = new ModelLocator();

            _parentGameObject = new GameObject();
            TestModel testModel = _parentGameObject.AddComponent <TestModel>();

            // Act
            modelLocator.AddModel(testModel);
            TestModel foundTestModel = modelLocator.GetModel <TestModel>();

            // Assert
            Assert.That(foundTestModel, Is.SameAs(testModel));
        }