public void DumpToString_noFields() { var result = ObjectDumperExtensions.DumpToString(Node.Root, "root", new DumpOptions { NoFields = true }); var matches = Regex.Matches(result, @"left-left"); Assert.Equal(1, matches.Count); Assert.DoesNotContain("fields", result); }
public IHttpActionResult CallBackCCG(string msisdn = "", string Result = "", string Reason = "", string productId = "", string transID = "", string TPCGID = "", string Songname = "") { try { if (!string.IsNullOrEmpty(msisdn) /*&& Regex.IsMatch(msisdn, "(^[2][0-9]{11}$)")*/) { ICallBackCCGEntity CallBackCCG = new CallBackCCGEntity { MSISDN = msisdn, Result = Result, Reason = Reason, productId = productId, transID = transID, TPCGID = TPCGID, Songname = Songname }; if (CallBackCCGService.InsertCallBackCCG(CallBackCCG)) { string [] args = new string[10]; Comviva.Billing.Engine.Program.Main(args); return(Ok("Success")); } else { LogService.LogWarning(MethodBase.GetCurrentMethod(), ObjectDumperExtensions.DumpToString <ICallBackCCGEntity>(CallBackCCG, "SMS"), "Failed to insert a message into the received queue"); return(Content(HttpStatusCode.InternalServerError, "Failed to insert the callbackCCG")); } } else { LogService.LogWarning(MethodBase.GetCurrentMethod(), string.Format("MSISDN: {0}", msisdn), "Invalid MSISDN)"); return(Content(HttpStatusCode.BadRequest, "Invalid MSISDN")); } } catch (Exception e) { LogService.LogError(MethodBase.GetCurrentMethod(), string.Format("MSISDN: {0}", msisdn), e); return(InternalServerError(e)); } }
private void writeToResultsBox(string str) { resultsTextBox.AppendText(str + Environment.NewLine); logger.Info(testSet.sessionInfo + Environment.NewLine + (ObjectDumperExtensions.DumpToString(fiber.results, "Detail Results for " + fiber.fiberId))); }
public void DumpToString_emptyClass() { var result = ObjectDumperExtensions.DumpToString(new EmptyClass(), "emptyClassInstance"); Assert.Equal("#1: emptyClassInstance [ObjectDumper.Tests.EmptyClass]" + Environment.NewLine, result); }