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); }
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]); }