Hello there,
Is there a way to write Unit Tests for Oxide Plugins? I'm a Java Developer and I normally I would do something similar to this:
@Test
public void do_random_test() {
// Mock due initialization
SuperPlugin sp = mock(SuperPlugin.class);
// This is a pure function that gets the display name from the BasePlayer, calling the real
// method.
when(sp.transformPlayer(any(BasePlayer.class))).thenCallRealMethod();
// Mocking the BasePlayer.
BasePlayer bp = mock(BasePlayer.class);
when(bp.getDisplayName()).thenReturn("SUPER PLAYER");
// Asserting the results.
Assert.assertThat(sp.transformPlayer(bp), is("SUPER MEGA PLAYER"));
}But C# looks like another beast. I tried something similar (using the Moq library) and got nothing. Should I implement a Facade/Adapter pattern? Is it even possible in a Oxide Plugin?