public LoginDataModel BuildModel(DataInstance instance) { switch (instance) { case DataInstance.ValidDetails: { Username = "******"; Password = "******"; return(this); } case DataInstance.InvalidPassword: { Username = "******"; Password = "******"; return(this); } case DataInstance.InvalidUsername: { Username = "******"; Password = "******"; return(this); } case DataInstance.InvalidDetails: { Username = "******"; Password = "******"; return(this); } default: throw new Exception("The instance you passed ' " + instance.ToString() + "' does not match any of the existng LoginDataModel instances."); } }