public void TestConvertNameGivenNameOnly() { this.xpn = new XPN(Activator.CreateInstance(typeof(ADT_A01)) as IMessage); this.xpn.GivenName.Value = "Nityan"; var actual = MessageUtil.ConvertName(this.xpn); Assert.AreEqual(1, actual.Component.Count(c => c.ComponentTypeKey == NameComponentKeys.Given)); Assert.AreEqual("Nityan", actual.Component.FirstOrDefault(c => c.ComponentTypeKey == NameComponentKeys.Given)?.Value); Assert.AreEqual(0, actual.Component.Count(c => c.ComponentTypeKey == NameComponentKeys.Family)); Assert.IsNull(actual.Component.FirstOrDefault(c => c.ComponentTypeKey == NameComponentKeys.Family)?.Value); }