Skip to content

Commit

Permalink
fix add map tests as the method works differently now
Browse files Browse the repository at this point in the history
  • Loading branch information
snixtho committed Oct 2, 2023
1 parent 4a7a03b commit a1ed3d4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
3 changes: 0 additions & 3 deletions src/EvoSC.Common/Services/MapService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ public async Task<IMap> AddMapAsync(MapStream mapStream)
await _matchSettings.EditMatchSettingsAsync(Path.GetFileNameWithoutExtension(_config.Path.DefaultMatchSettings),
builder => builder.AddMap($"EvoSC/{fileName}"));

/*await _serverClient.Remote.InsertMapAsync($"EvoSC/{fileName}");
await _serverClient.Remote.SaveMatchSettingsAsync($"MatchSettings/{_config.Path.DefaultMatchSettings}"); */

return map;
}

Expand Down
6 changes: 0 additions & 6 deletions tests/EvoSC.Common.Tests/Services/MapServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ public async Task Add_Map_Returns_Map()

var createdMap = await _mapService.AddMapAsync(mapStream);

_server.Remote.Verify(m => m.InsertMapAsync("EvoSC/" + mapMetadata.MapUid + ".Map.Gbx"));

Assert.Equal(MapProviders.ManiaExchange, createdMap.ExternalMapProvider);
Assert.Equal(map.ExternalId, createdMap.ExternalId);
Assert.Equal(map.Uid, createdMap.Uid);
Expand Down Expand Up @@ -209,8 +207,6 @@ public async Task Add_Map_New_Map_Version_Returns_Map()

var updatedMap = await _mapService.AddMapAsync(mapStream);

_server.Remote.Verify(m => m.InsertMapAsync("EvoSC/" + mapMetadata.MapUid + ".Map.Gbx"));

Assert.NotEqual(mapMetadata.ExternalVersion, updatedMap.ExternalVersion);
Assert.Equal(MapProviders.ManiaExchange, updatedMap.ExternalMapProvider);
Assert.Equal(map.ExternalId, updatedMap.ExternalId);
Expand Down Expand Up @@ -323,8 +319,6 @@ public async Task Add_Maps_Return_Maps()

var createdMaps = await _mapService.AddMapsAsync(new List<MapStream> { mapStream, mapStream2 });

_server.Remote.Verify(m => m.InsertMapAsync(It.IsAny<string>()), Times.Exactly(2));

Assert.Equal(2, createdMaps.Count());
}

Expand Down

0 comments on commit a1ed3d4

Please sign in to comment.