public void EnumConvertName() { var expectedEnum = GenderTypeEnum.Male; var expectedEnumName = GenderTypeEnum.Male.Name; var convert = EntityFrameworkConverter.ToEnumName <GenderTypeEnum, int>(); var actualEnum = convert.ConvertFromProvider(expectedEnumName); var actualEnumName = convert.ConvertToProvider(expectedEnum); Assert.AreEqual(expectedEnum, actualEnum); Assert.AreEqual(expectedEnumName, actualEnumName); }
public void StatusInactiveConvert() { var expectedEnum = StatusEnum.Inactive; var expectedInactive = StatusEnum.Inactive.ToString(); var convert = EntityFrameworkConverter.ToStatus(); var actualEnum = convert.ConvertFromProvider(expectedInactive); var actualInactive = convert.ConvertToProvider(expectedEnum); Assert.AreEqual(expectedEnum, actualEnum); Assert.AreEqual(expectedInactive, actualInactive); }
public void NameConvert() { var value = "Juan pedro"; var expectedEnum = Name.Create(value); var expectedString = value; var convert = EntityFrameworkConverter.ToName <Name>(); var actualEnum = convert.ConvertFromProvider(expectedString); var actualString = convert.ConvertToProvider(expectedEnum); Assert.AreEqual(expectedEnum.ToString(), actualEnum.ToString()); Assert.AreEqual(expectedString, actualString); }
public void EmailConvert() { var value = "*****@*****.**"; var expectedEnum = Email.Create(value); var expectedString = value; var convert = EntityFrameworkConverter.ToEmail <Email>(); var actualEnum = convert.ConvertFromProvider(expectedString); var actualString = convert.ConvertToProvider(expectedEnum); Assert.AreEqual(expectedEnum.ToString(), actualEnum.ToString()); Assert.AreEqual(expectedString, actualString); }
public void SubdomainConvert() { var value = "documents"; // Ej. documents.kitpymes.com var expectedEnum = Subdomain.Create(value); var expectedString = value; var convert = EntityFrameworkConverter.ToSubdomain <Subdomain>(); var actualEnum = convert.ConvertFromProvider(expectedString); var actualString = convert.ConvertToProvider(expectedEnum); Assert.AreEqual(expectedEnum.ToString(), actualEnum.ToString()); Assert.AreEqual(expectedString, actualString); }