public WorkspaceFixContext(Suggestion suggestion, FixAction fix, List <AspxToken> tokens, List <CsharpFileBuilder> csharpFiles) { Suggestion = suggestion; Fix = fix; Tokens = tokens; CsharpFiles = csharpFiles; }
public void ActionTest() { Fix target = new Fix("job000001", 4, new DateTime(2011, 02, 04), "client_name", "user_name", "open", FixAction.Unfixed); FixAction expected = FixAction.Unfixed; FixAction actual = target.Action; Assert.AreEqual(expected, actual); }
public void ParseFixesCmdTaggedData(TaggedObject obj, string offset, bool dst_mismatch) { if (obj.ContainsKey("Job")) { JobId = obj["Job"]; } if (obj.ContainsKey("Change")) { int c = -1; int.TryParse(obj["Change"], out c); ChangeId = c; } if (obj.ContainsKey("Date")) { DateTime UTC = FormBase.ConvertUnixTime(obj["Date"]); DateTime GMT = new DateTime(UTC.Year, UTC.Month, UTC.Day, UTC.Hour, UTC.Minute, UTC.Second, DateTimeKind.Unspecified); Date = FormBase.ConvertFromUTC(GMT, offset, dst_mismatch); } if (obj.ContainsKey("User")) { UserName = obj["User"]; } if (obj.ContainsKey("Client")) { ClientName = obj["Client"]; } if (obj.ContainsKey("Status")) { Status = obj["Status"]; } if (obj.ContainsKey("Action")) { _action = obj["Action"]; } else { Action = FixAction.Fixed; } }
public Fix(string jobid, int changeid, DateTime date, string clientname, string username, string status, FixAction action ) { JobId = jobid; ChangeId = changeid; Date = date; ClientName = clientname; UserName = username; Status = status; Action = action; }
private void ApplyFix(FixAction fix) { var context = new WorkspaceFixContext(null, fix, workspace.Tokens, workspace.CsharpFiles); fix.Apply(context); }