protected override SkiaChart WieldTool(ProgressTask task, DrillSettings settings)
    {
        var driller = new Driller(_httpClient, task, settings);
        var results = driller.Run();

        return(new LineChart(results));
    }
Exemple #2
0
        private static void Test_MoveTowardsMostDamagedZone_Helper(Dictionary <ZoneLocation, int> countsByLocation, StationLocation currentStation, StationLocation expectedNewStation)
        {
            var driller = new Driller {
                CurrentStation = currentStation
            };

            driller.SetInitialPlacement(3);
            var threatController = new ThreatController(null, null, new List <ExternalThreat>(), new List <InternalThreat>(), null);
            var mockSittingDuck  = new Mock <SittingDuck>(MockBehavior.Strict, threatController, null, null);

            foreach (var countByLocation in countsByLocation)
            {
                var count    = countByLocation.Value;
                var location = countByLocation.Key;
                mockSittingDuck
                .Setup(f => f.GetDamageToZone(location))
                .Returns(count)
                .Verifiable();
                mockSittingDuck
                .Setup(f => f.RedDoorIsSealed)
                .Returns(false);
                mockSittingDuck
                .Setup(f => f.BlueDoorIsSealed)
                .Returns(false);
            }
            driller.Initialize(mockSittingDuck.Object, null, null);
            driller.MoveTowardsMostDamagedZone();
            Assert.AreEqual(expectedNewStation, driller.CurrentStation);
        }
    public void CanDrill()
    {
        //arrange
        var http    = new HttpClient(new MockHttpMessageHandler());
        var task    = new ProgressTask(123, "test", 0, false);
        var options = new DrillSettings
        {
            URL      = new Uri("http://localhost"),
            RPS      = 1,
            Duration = 1
        };
        var driller = new Driller(http, task, options);

        //act
        var results = driller.Run();

        //assert
        Assert.Equal(1, results.Count);
    }