Exemplo n.º 1
0
    void AddDestToList(NodeShape dest)
    {
        GameObject  newElement  = Instantiate(dListElement) as GameObject;
        DestElement listElement = newElement.GetComponent <DestElement>();

        listElement.Initialize(dest, dListContentParent, () =>
        {
            Debug.Log(dest.name);
            OnDestSelected(dest);
        });
    }
Exemplo n.º 2
0
        public void ArrayTypeIsMappedToICollectionTypeCorrectly()
        {
            var mapper = new MemberMapper();

            var source = new SourceElement[]
            {
                new SourceElement
                {
                    Value = "X"
                }
            };

            var destination = new DestElement[0];

            var result = mapper.Map <SourceElement[], ICollection <DestElement> >(source, destination);

            Assert.AreEqual("X", result.First().Value);
        }
Exemplo n.º 3
0
        public void IEnumerableTypeIsMappedToArrayTypeCorrectly()
        {
            var mapper = new MemberMapper();

            var source = new List <SourceElement>
            {
                new SourceElement
                {
                    Value = "X"
                }
            };

            var destination = new DestElement[0];

            var result = mapper.Map <IEnumerable <SourceElement>, DestElement[]>(source, destination);

            Assert.AreEqual("X", result.First().Value);
        }
Exemplo n.º 4
0
        public void ListTypeIsMappedToICollectionTypeCorrectly()
        {
            var mapper = new MemberMapper();

              var source = new List<SourceElement>
              {
            new SourceElement
            {
              Value = "X"
            }
              };

              var destination = new DestElement[0];

              var result = mapper.Map<List<SourceElement>, ICollection<DestElement>>(source, destination);

              Assert.AreEqual("X", result.First().Value);
        }
Exemplo n.º 5
0
        public void IEnumerableTypeIsMappedToArrayTypeCorrectly()
        {
            var mapper = new MemberMapper();

              var source = new List<SourceElement>
              {
            new SourceElement
            {
              Value = "X"
            }
              };

              var destination = new DestElement[0];

              var result = mapper.Map<IEnumerable<SourceElement>, DestElement[]>(source, destination);

              Assert.AreEqual("X", result.First().Value);
        }