Ejemplo n.º 1
0
        /// <summary>
        /// Load a Comme ill Faut Asset definition from a DTO object.
        /// </summary>
        /// <remarks>
        /// Use this to procedurally configure the asset.
        /// </remarks>
        /// <param name="dto">
        /// The DTO containing the data to load
        /// </param>
        public void LoadFromDTO(CommeillFautDTO dto)
        {
            m_SocialExchanges.Clear();


            if (dto._SocialExchangesDtos != null)
            {
                foreach (var c in dto._SocialExchangesDtos)
                {
                    m_SocialExchanges.Add(new SocialExchange(c));
                }
            }
        }
Ejemplo n.º 2
0
        public void Test_CIF_LoadFromDTO()
        {
            var cif = BuildCIFAsset();

            var seDTO = new SocialExchangeDTO()
            {
                Name               = Name.BuildName("Compliment"),
                Description        = "When we are friends..",
                StartingConditions = new Conditions.DTOs.ConditionSetDTO(),
                Steps              = new List <Name>(),
                InfluenceRules     = new List <InfluenceRuleDTO>(),
                Target             = Name.BuildName("[x]")
            };

            var cifDTO = new CommeillFautDTO()
            {
                _SocialExchangesDtos = new[] { seDTO }
            };


            cif.LoadFromDTO(cifDTO);
            Assert.AreEqual(cif.GetAllSocialExchanges().FirstOrDefault().Name.ToString(), "Compliment");
        }