Exemplo n.º 1
0
        public override Task <XboxLiveHttpResponse> GetResponseWithoutAuth()
        {
            // Save the mock data out for testing.
            string requestData = JsonConvert.SerializeObject(this, Formatting.Indented);

            string outputDir = @"C:\Temp\MockData";

            Directory.CreateDirectory(outputDir);
            string outputPath = Path.Combine(outputDir, "data.txt");

            File.AppendAllText(outputPath, requestData);

            return(Task.FromResult(MockXboxLiveData.GetMockResponse(this)));
        }
        public override Task <XboxLiveHttpResponse> GetResponseWithoutAuth()
        {
            // Save the mock data out for testing.
            string requestData = JsonConvert.SerializeObject(this, Formatting.Indented);

            string outputDir = @"C:\Temp\MockData";

            if (!Directory.Exists(outputDir))
            {
                Directory.CreateDirectory(outputDir);
            }

            string outputPath = Path.Combine(outputDir, "data.txt");

            using (var stream = this.GetWriteStream(outputPath))
            {
                using (var writer = new StreamWriter(stream))
                {
                    writer.Write(requestData);
                }
            }
            return(Task.FromResult(MockXboxLiveData.GetMockResponse(this)));
        }