public static IEnumerable <TestCaseData> GetTestData(EntityDataSourceType entityDataSourceType) { string csvPath = UnitTestsHelper.DataFile_AllAccounts_Validate; if (entityDataSourceType == EntityDataSourceType.UPNB2BGuestAccounts) { csvPath = UnitTestsHelper.DataFile_GuestAccountsUPN_Validate; } DataTable dt = DataTable.New.ReadCsv(csvPath); foreach (Row row in dt.Rows) { var registrationData = new ValidateEntityData(); registrationData.ClaimValue = row["ClaimValue"]; registrationData.ShouldValidate = Convert.ToBoolean(row["ShouldValidate"]); registrationData.IsMemberOfTrustedGroup = Convert.ToBoolean(row["IsMemberOfTrustedGroup"]); registrationData.UserType = row["UserType"]; yield return(new TestCaseData(new object[] { registrationData })); } }
public static IEnumerable <TestCaseData> GetTestData(EntityDataSourceType entityDataSourceType) { string csvPath = UnitTestsHelper.DataFile_AllAccounts_Search; if (entityDataSourceType == EntityDataSourceType.UPNB2BGuestAccounts) { csvPath = UnitTestsHelper.DataFile_GuestAccountsUPN_Search; } DataTable dt = DataTable.New.ReadCsv(csvPath); foreach (Row row in dt.Rows) { var registrationData = new SearchEntityData(); registrationData.Input = row["Input"]; registrationData.ExpectedResultCount = Convert.ToInt32(row["ExpectedResultCount"]); registrationData.ExpectedEntityClaimValue = row["ExpectedEntityClaimValue"]; registrationData.ResultType = row["ResultType"]; registrationData.UserType = row["UserType"]; yield return(new TestCaseData(new object[] { registrationData })); } }