Esempio n. 1
0
        public void WhenSetNullableIntIsCalledWitNullThenValueIsNotInDictionary()
        {
            ActionAttributes attributes = new ActionAttributes();

            string memberName = "_name";

            attributes.SetNullableInt(memberName, null);

            IReadOnlyDictionary <string, string> data = attributes.Data;

            Assert.AreEqual(0, data.Count);
        }
Esempio n. 2
0
        public void WhenSetNullableIntIsCalledWithNotNullThenValueIsInDictionary()
        {
            ActionAttributes attributes = new ActionAttributes();

            string memberName  = "_name";
            int    memberValue = 7;

            attributes.SetNullableInt(memberName, memberValue);

            string key = "name";
            IReadOnlyDictionary <string, string> data = attributes.Data;

            Assert.AreEqual(1, data.Count);
            Assert.IsTrue(data.ContainsKey(key));
            Assert.AreEqual(memberValue.ToString(), data[key]);
        }