コード例 #1
0
        public async Task Should_not_export_dlc_when_no_dlc()
        {
            var service = new DLCService(null, null, null, null, null, null);
            var result  = await service.ExportAsync(new Game()
            {
                ExecutableLocation = string.Empty,
                Type = "Should_not_return_dlc_objects_when_game_path_not_set"
            }, new List <IDLC>());

            result.Should().BeFalse();
        }
コード例 #2
0
        public async Task Should_not_export_dlc_when_no_game()
        {
            var service = new DLCService(null, null, null, null, null, null);
            var result  = await service.ExportAsync(null, new List <IDLC>()
            {
                new DLC()
                {
                    Name = "test",
                    Path = "dlc/dlc01.dlc"
                }
            });

            result.Should().BeFalse();
        }
コード例 #3
0
        public async Task Should_export_dlc()
        {
            var dlcExport = new Mock <IDLCExporter>();

            dlcExport.Setup(p => p.ExportDLCAsync(It.IsAny <DLCParameters>())).ReturnsAsync((DLCParameters p) => { return(p.DLC.Any()); });
            var service = new DLCService(dlcExport.Object, null, null, null, null, null);
            var result  = await service.ExportAsync(new Game()
            {
                ExecutableLocation = string.Empty,
                Type = "Should_export_dlc"
            }, new List <IDLC>()
            {
                new DLC()
                {
                    Name      = "test",
                    Path      = "dlc/dlc01.dlc",
                    IsEnabled = false
                }
            });

            result.Should().BeTrue();
        }