public static async Task <bool> SendAsync(ITracker tracker, string userTimeingCatagory, string userTimeingVariableName, int userTimingTime) { var hit = new TimingHit(userTimeingCatagory, userTimeingVariableName, userTimingTime) { DataSource = "app" }; // create the hit request. var request = (HitRequestBase)tracker.CreateHitRequest(hit); // Run a debug check to ensure its valid. var debugResponse = await request.ExecuteDebugAsync(); if (!((DebugResult)debugResponse).IsValid()) { return(false); } // Send hit. var collectRequest = await request.ExecuteCollectAsync(); Console.Write(collectRequest.RawResponse); return(true); }
public void Create_TimingHit_All_Validate_Values() { var hit = new TimingHit(UserTimeingCatagory, UserTimeingVariableName, UserTimingTime); Assert.Equal(UserTimeingCatagory, hit.UserTimingCatagory); Assert.Equal(UserTimeingVariableName, hit.UserTimingVariableName); Assert.Equal(UserTimingTime.ToString(), hit.UserTimingTime); Assert.Equal(HitType, hit.HitType, true); }
public void Create_PageViewHit_All_Validate_Success() { var hit = new TimingHit(UserTimeingCatagory, UserTimeingVariableName, UserTimingTime); Assert.True(hit.Validate()); }