Exemplo n.º 1
0
        public void SetUp()
        {
            var selectedOther = new SelfReferentialEntity
            {
                Id = 2
            };

            this.Entity = new SelfReferentialEntity
            {
                Id    = 1,
                Other = selectedOther
            };

            var repository = new Mock <IBootstrapRepository <SelfReferentialEntity> >();

            repository.Setup(r => r.GetAll()).Returns(new[] { this.Entity, selectedOther });

            this.RelationsConfig = new RelationsConfig <SelfReferentialEntity>();

            this.RelationConfig = this.RelationsConfig.Relation(e => e.Other)
                                  .HasOptions(e => repository.Object.GetAll());

            var mappingCreator = new MappingCreator <SelfReferentialEntity>(this.RelationsConfig);

            mappingCreator.CreateEntityToViewModelMap <SelfReferentialEntity, SelfReferentialEntityViewModel>();
            mappingCreator.CreateEntityToChoiceMap <SelfReferentialEntity, SelfReferentialEntityViewModel>();
        }
Exemplo n.º 2
0
 private void Setup()
 {
     //alternative way to get elements. cons : if there is no element with such tag it creates an error
     _levelManager   = FindObjectOfType <LevelManager>();
     _mappingCreator = FindObjectOfType <MappingCreator>();
     //_player = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerController>();
     _player = FindObjectOfType <Player>();
     //_uiManager = FindObjectOfType<UIManager>();
 }