Skip to content

Commit

Permalink
implement openGL renderer, implement OpenAL wav player, alternate loc…
Browse files Browse the repository at this point in the history
…ation color check
  • Loading branch information
TalicZealot committed Jun 30, 2024
1 parent 9d3f1ae commit 9af4806
Show file tree
Hide file tree
Showing 35 changed files with 848 additions and 1,292 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void ThrowArgumentNullException_WhenNotificationServiceIsNull()
var mockedWatchlistService = Substitute.For<IWatchlistService>();
var mockedCoopMessanger = Substitute.For<ICoopController>();
//Act&Assert
Assert.Throws<ArgumentNullException>(() => new CoopReceiver(mockedToolConfig, mockedWatchlistService, mockedSotnApi, null, mockedCoopMessanger));
Assert.Throws<ArgumentNullException>(() => new CoopReceiver(mockedToolConfig, mockedWatchlistService, mockedSotnApi, null, mockedCoopMessanger));
}

[Fact]
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,88 +1,67 @@
using BizHawk.Client.Common;
using NSubstitute;
using NSubstitute;
using SotnApi.Interfaces;
using SotnRandoTools.Configuration;
using SotnRandoTools.Configuration.Interfaces;
using SotnRandoTools.Services;
using System;
using System.Collections.Generic;
using Xunit;

namespace SotnRandoTools.RandoTracker.Tests.TrackerTests
{
public class ConstructorShould
{
[Fact]
public void ThrowArgumentNullException_WhenGraphicsIsNull()
{
//Arrange
var mockedMemAPI = Substitute.For<IMemoryApi>();
var mockedGraphicsEngine = Substitute.For<ITrackerRenderer>();
var mockedToolConfig = Substitute.For<IToolConfig>();
var mockedwatchlistService = Substitute.For<IWatchlistService>();
var mockedSotnApi = Substitute.For<ISotnApi>();
var mockedNotificationService = Substitute.For<INotificationService>();
//Act&Assert
Assert.Throws<ArgumentNullException>(() => new Tracker(null, mockedToolConfig, mockedwatchlistService, mockedSotnApi, mockedNotificationService));
}

[Fact]
public void ThrowArgumentNullException_WhenToolConfigIsNull()
{
//Arrange
var mockedGraphicsEngine = Substitute.For<ITrackerRenderer>();
var mockedToolConfig = Substitute.For<IToolConfig>();
var mockedwatchlistService = Substitute.For<IWatchlistService>();
var mockedSotnApi = Substitute.For<ISotnApi>();
var mockedNotificationService = Substitute.For<INotificationService>();
//Act&Assert
Assert.Throws<ArgumentNullException>(() => new Tracker(mockedGraphicsEngine, null, mockedwatchlistService, mockedSotnApi, mockedNotificationService));
Assert.Throws<ArgumentNullException>(() => new Tracker(null, mockedwatchlistService, mockedSotnApi, mockedNotificationService));
}

[Fact]
public void ThrowArgumentNullException_WhenWatchlistServiceIsNull()
{
//Arrange
var mockedGraphicsEngine = Substitute.For<ITrackerRenderer>();
var mockedToolConfig = Substitute.For<IToolConfig>();
var mockedwatchlistService = Substitute.For<IWatchlistService>();
var mockedSotnApi = Substitute.For<ISotnApi>();
var mockedNotificationService = Substitute.For<INotificationService>();
//Act&Assert
Assert.Throws<ArgumentNullException>(() => new Tracker(mockedGraphicsEngine, mockedToolConfig, null, mockedSotnApi, mockedNotificationService));
Assert.Throws<ArgumentNullException>(() => new Tracker(mockedToolConfig, null, mockedSotnApi, mockedNotificationService));
}

[Fact]
public void ThrowArgumentNullException_WhenSotnApiIsNull()
{
//Arrange
var mockedGraphicsEngine = Substitute.For<ITrackerRenderer>();
var mockedToolConfig = Substitute.For<IToolConfig>();
var mockedwatchlistService = Substitute.For<IWatchlistService>();
var mockedSotnApi = Substitute.For<ISotnApi>();
var mockedNotificationService = Substitute.For<INotificationService>();
//Act&Assert
Assert.Throws<ArgumentNullException>(() => new Tracker(mockedGraphicsEngine, mockedToolConfig, mockedwatchlistService, null, mockedNotificationService));
Assert.Throws<ArgumentNullException>(() => new Tracker(mockedToolConfig, mockedwatchlistService, null, mockedNotificationService));
}

[Fact]
public void ThrowArgumentNullException_WhenNotificationServiceIsNull()
{
//Arrange
var mockedGraphicsEngine = Substitute.For<ITrackerRenderer>();
var mockedToolConfig = Substitute.For<IToolConfig>();
var mockedwatchlistService = Substitute.For<IWatchlistService>();
var mockedSotnApi = Substitute.For<ISotnApi>();
var mockedNotificationService = Substitute.For<INotificationService>();
//Act&Assert
Assert.Throws<ArgumentNullException>(() => new Tracker(mockedGraphicsEngine, mockedToolConfig, mockedwatchlistService, mockedSotnApi, null));
Assert.Throws<ArgumentNullException>(() => new Tracker(mockedToolConfig, mockedwatchlistService, mockedSotnApi, null));
}

[Fact]
public void ReturnsAnInstance_WhenParametersAreNotNull()
{
//Arrange
var mockedGraphicsEngine = Substitute.For<ITrackerRenderer>();
var mockedToolConfig = Substitute.For<IToolConfig>();
var mockedwatchlistService = Substitute.For<IWatchlistService>();
var mockedSotnApi = Substitute.For<ISotnApi>();
Expand All @@ -91,14 +70,8 @@ public void ReturnsAnInstance_WhenParametersAreNotNull()
mockedToolConfig.Tracker.Locations = false;
mockedToolConfig.Tracker.UseOverlay = false;
mockedToolConfig.Tracker.EnableAutosplitter = false;
mockedGraphicsEngine
.When(g => g.InitializeItems(Arg.Any<Models.TrackerRelic[]>(), Arg.Any<Models.Item[]>(), Arg.Any< Models.Item[]>()))
.Do(x => { });
mockedGraphicsEngine
.When(g => g.CalculateGrid(Arg.Any<int>(), Arg.Any<int>()))
.Do(x => { });
//Act
Tracker tracker = new Tracker(mockedGraphicsEngine, mockedToolConfig, mockedwatchlistService, mockedSotnApi, mockedNotificationService);
Tracker tracker = new Tracker(mockedToolConfig, mockedwatchlistService, mockedSotnApi, mockedNotificationService);
//Assert
Assert.NotNull(tracker);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ public void ThrowArgumentNullException_WhenToolConfigIsNull()
var mockedToolConfig = Substitute.For<IToolConfig>();
var mockedGuiApi = Substitute.For<IGuiApi>();
var mockedEmuClientApi = Substitute.For<IEmuClientApi>();
var mockedGlobalConfig = Substitute.For<Config>();
mockedToolConfig.Coop = new Configuration.CoopConfig();
//Act&Assert
Assert.Throws<ArgumentNullException>(() => new NotificationService(null, mockedGuiApi, mockedEmuClientApi));
Assert.Throws<ArgumentNullException>(() => new NotificationService(null, mockedGuiApi, mockedEmuClientApi, mockedGlobalConfig));
}

[Fact]
Expand All @@ -27,9 +28,10 @@ public void ThrowArgumentNullException_WhenGuiApiIsNull()
var mockedToolConfig = Substitute.For<IToolConfig>();
var mockedGuiApi = Substitute.For<IGuiApi>();
var mockedEmuClientApi = Substitute.For<IEmuClientApi>();
var mockedGlobalConfig = Substitute.For<Config>();
mockedToolConfig.Coop = new Configuration.CoopConfig();
//Act&Assert
Assert.Throws<ArgumentNullException>(() => new NotificationService(mockedToolConfig, null, mockedEmuClientApi));
Assert.Throws<ArgumentNullException>(() => new NotificationService(mockedToolConfig, null, mockedEmuClientApi, mockedGlobalConfig));
}

[Fact]
Expand All @@ -39,9 +41,10 @@ public void ThrowArgumentNullException_WhenEmuClientIsNull()
var mockedToolConfig = Substitute.For<IToolConfig>();
var mockedGuiApi = Substitute.For<IGuiApi>();
var mockedEmuClientApi = Substitute.For<IEmuClientApi>();
var mockedGlobalConfig = Substitute.For<Config>();
mockedToolConfig.Coop = new Configuration.CoopConfig();
//Act&Assert
Assert.Throws<ArgumentNullException>(() => new NotificationService(mockedToolConfig, mockedGuiApi, null));
Assert.Throws<ArgumentNullException>(() => new NotificationService(mockedToolConfig, mockedGuiApi, null, mockedGlobalConfig));
}

[Fact]
Expand All @@ -51,9 +54,10 @@ public void ReturnsAnInstance_WhenParametersAreNotNull()
var mockedToolConfig = Substitute.For<IToolConfig>();
var mockedGuiApi = Substitute.For<IGuiApi>();
var mockedEmuClientApi = Substitute.For<IEmuClientApi>();
var mockedGlobalConfig = Substitute.For<Config>();
mockedToolConfig.Coop = new Configuration.CoopConfig();
//Act
NotificationService notificationService = new NotificationService(mockedToolConfig, mockedGuiApi, mockedEmuClientApi);
NotificationService notificationService = new NotificationService(mockedToolConfig, mockedGuiApi, mockedEmuClientApi, mockedGlobalConfig);
//Assert
Assert.NotNull(notificationService);
}
Expand Down

This file was deleted.

5 changes: 5 additions & 0 deletions SotnRandoTools/TrackerOverlay/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ body {
width: 100%;
height: 100%;
image-rendering: pixelated;
clip-path: rect(0px, 0px, 14px, 14px);
}

#SoulOfBat {
clip-path: rect(0px, 0px, 14px, 14px);
}

.uncollected {
Expand Down
2 changes: 1 addition & 1 deletion SotnRandoTools/src/Configuration/TrackerConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public void Default()
CustomLocationsCustom = false;
CustomExtension = "";
Width = 260;
Height = 490;
Height = 440;
Username = "";
OverlaySlots = new byte[]
{
Expand Down
15 changes: 0 additions & 15 deletions SotnRandoTools/src/Constants/InputKeys.cs

This file was deleted.

22 changes: 0 additions & 22 deletions SotnRandoTools/src/Constants/OctoshockPlaystationInputKeys.cs

This file was deleted.

Loading

0 comments on commit 9af4806

Please sign in to comment.