Skip to content

Commit

Permalink
remove unnecessary usings
Browse files Browse the repository at this point in the history
  • Loading branch information
dgkanatsios committed Aug 1, 2022
1 parent 47a43ab commit 9a9a4ce
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions LocalMultiplayerAgent.UnitTest/ControllerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,20 @@

namespace Microsoft.Azure.Gaming.VmAgent.UnitTests
{
using System;
using System.Configuration;
using System.IO;
using System.Net.Http;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using AgentInterfaces;
using Core.Interfaces;
using FluentAssertions;
using LocalMultiplayerAgent.Config;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.TestHost;
using Microsoft.Azure.Gaming.LocalMultiplayerAgent;
using Moq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using VisualStudio.TestTools.UnitTesting;

[TestClass]
public class ControllerTests
{

private static readonly string jsonMediaType = "application/json";
private TestServer server;
protected HttpClient Client { get; private set; }

Expand All @@ -45,15 +36,15 @@ public async Task ValidateStandingByToInitializingThrows()
CurrentGameState = SessionHostStatus.StandingBy
};
var json = JsonConvert.SerializeObject(heartbeat);
var data = new StringContent(json, Encoding.UTF8, "application/json");
var data = new StringContent(json, Encoding.UTF8, jsonMediaType);
var value = await this.Client.PostAsync($"v1/sessionHosts/{sessionHostId}/heartbeats", data);

Assert.IsTrue(value.IsSuccessStatusCode);

// send the first heartbeat with "StandingBy"
heartbeat.CurrentGameState = SessionHostStatus.Initializing;
json = JsonConvert.SerializeObject(heartbeat);
data = new StringContent(json, Encoding.UTF8, "application/json");
data = new StringContent(json, Encoding.UTF8, jsonMediaType);

value = await this.Client.PostAsync($"v1/sessionHosts/{sessionHostId}/heartbeats", data);
Assert.IsFalse(value.IsSuccessStatusCode);
Expand Down

0 comments on commit 9a9a4ce

Please sign in to comment.