public void Setup()
        {
            SetupServiceMocks();
            inputEntityAttributes = new Dictionary <string, HashSet <string> >();

            systemUnderTest = new AttributeController();
        }
Ejemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     //In order to figure out which way the character is facing I need to access the HeroMovement script
     hm          = gameObject.GetComponent <HeroMovement>();
     myAttribute = gameObject.GetComponent <AttributeController>();
     animator    = gameObject.GetComponent <Animator>();
 }
Ejemplo n.º 3
0
        private void PopulateAttributes(string entityLogicalName, ListViewItem listViewSelectedItem, ServiceParameters serviceParameters)
        {
            if (!workingstate)
            {
                lvAttributes.Items.Clear();
                chkAllAttributes.Checked = true;

                InitFilter(listViewSelectedItem);
                if (listViewSelectedItem != null)
                {
                    using (var bwFill = new BackgroundWorker())
                    {
                        bwFill.DoWork += (sender, e) =>
                        {
                            var unmarkedattributes = Settings[organisationId.ToString()][this.entityLogicalName].UnmarkedAttributes;
                            var controller         = new AttributeController();
                            var attributes         = controller.GetAttributeList(entityLogicalName, cbShowSystemAttributes.Checked, serviceParameters);

                            e.Result = controller.ProcessAllAttributeMetadata(unmarkedattributes, attributes, entityLogicalName, entityAttributes);
                        };
                        bwFill.RunWorkerCompleted += (sender, e) =>
                        {
                            var controller = new ListController();
                            controller.OnPopulateCompletedAction(e, NotificationService, this, lvAttributes);
                            ManageWorkingState(false);
                        };
                        bwFill.RunWorkerAsync();
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public void PostContent()
        {
            // Arrange
            //var mock = new Mock<IAttribute_Repository>();
            //mock.SetupGet(m => m.Attributes)
            //.Returns(new List<IOMappingWebApi.Model.Attribute>
            //{
            //    new IOMappingWebApi.Model.Attribute(){ ID = 1, Name = "RAW" },
            //    new IOMappingWebApi.Model.Attribute(){ ID = 2, Name = "RAW2" },
            //    new IOMappingWebApi.Model.Attribute(){ ID = 3, Name = "RAW3" },
            //});


            // Act
            //var Attribute_Ctrl = new AttributeController(mock.Object);
            AttributeController Attribute_Ctrl = new AttributeController(new Attribute_Repository(new GalaxyObjectContext()));
            //Attribute_Ctrl.PushToDatabase(new List<IOMappingWebApi.Model.Attribute>
            //{
            //    new IOMappingWebApi.Model.Attribute() { Name = "RAW" },
            //    new IOMappingWebApi.Model.Attribute() { Name = "Meters" },
            //    new IOMappingWebApi.Model.Attribute() { Name = "Meters2" },
            //    new IOMappingWebApi.Model.Attribute() { Name = "RAW3" },
            //    new IOMappingWebApi.Model.Attribute() { Name = "Meters3" },
            //});



            // Assert
            //Assert.Equal(mock.Object.Attributes, null);

            //foreach (IOMappingWebApi.Model.Attribute Att in mock.Object.Attributes)
            //{
            //}
        }
Ejemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     myMovement   = gameObject.GetComponent <HeroMovement>();
     myAttribute  = gameObject.GetComponent <AttributeController>();
     hasWall      = false;
     BigAttack    = false;
     LittleAttack = false;
     animator     = gameObject.GetComponent <Animator>();
 }
Ejemplo n.º 6
0
 //通过字典去存储属性
 private void Awake()
 {
     //如果当前未选择人物,则默认选择第一个人物
     if (currentPerson == null)
     {
         currentPerson = personList[0];
     }
     AfterSelectPerson();
     Instance = this;
 }
Ejemplo n.º 7
0
    // Use this for initialization
    void Awake()
    {
        //anim = GetComponent<Animator>();
        rb2d             = GetComponent <Rigidbody2D>();
        myAttributes     = GetComponent <AttributeController>();
        currentMoveForce = moveForce;
        currentMaxSpeed  = maxSpeed;
        animator         = gameObject.GetComponent <Animator>();

        if (gameObject.name == "Kitty(Clone)" || gameObject.name == "Kitty")
        {
            isKitty = true;
        }
    }
Ejemplo n.º 8
0
        private void ListViewAttributesItemCheck(object sender, ItemCheckEventArgs e)
        {
            var indexNumber = e.Index;
            var logicalName = lvAttributes.Items[indexNumber].SubItems[1].Text;
            var controller  = new AttributeController();

            if (entityAttributes.ContainsKey(entityLogicalName))
            {
                controller.StoreAttriubteIfKeyExists(logicalName, e, entityAttributes, entityLogicalName);
            }
            else
            {
                controller.StoreAttributeIfRequiresKey(logicalName, e, entityAttributes, entityLogicalName);
            }
        }
        public void Setup()
        {
            var options = new DbContextOptionsBuilder <ItemContext>().UseInMemoryDatabase(databaseName: "InMemoryDatabase")
                          .Options;

            _itemContext = new ItemContext(options);

            MapperConfiguration config = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile(new AutoMappingProfile());
            });
            IMapper _mapper = new Mapper(config);

            _attributeRepository = new AttributeRepository(_itemContext, _mapper);
            _attributeController = new AttributeController(_attributeRepository);
        }
Ejemplo n.º 10
0
 void Start()
 {
     myAttribute = gameObject.GetComponent <AttributeController>();
     if (healthSlider != null)
     {
         health = myAttribute.getHealth();
         healthSlider.maxValue = health;
         healthSlider.value    = health;
     }
     if (powerSlider != null)
     {
         powerSlider.maxValue = myAttribute.bigCooldown;
         powerSlider.value    = myAttribute.bigCooldown;
         oldFire = 0;
     }
 }
Ejemplo n.º 11
0
 public MyPhotos.Attribute UpdateAttribute(MyPhotos.Attribute attribute)
 {
     return(AttributeController.updateAttribute(attribute));
 }
Ejemplo n.º 12
0
 public List <MyPhotos.Attribute> GetAttributes()
 {
     return(AttributeController.getAttributes());
 }
Ejemplo n.º 13
0
 public MyPhotos.Attribute GetAttributeById(int id)
 {
     return(AttributeController.getAttribute(id));
 }
Ejemplo n.º 14
0
 public int DeleteAttribute(int id)
 {
     return(AttributeController.deleteAttribute(id));
 }
Ejemplo n.º 15
0
        //DATAFILE END


        //ATTRIBUTE START
        public bool AddAttribute(MyPhotos.Attribute attribute)
        {
            return(AttributeController.addAttribute(attribute));
        }