Beispiel #1
0
        public BotServiceTest()
        {
            _fakedBotRepoService     = A.Fake<IBotRepoService>();
            _fakedItemRepoService    = A.Fake<IItemRepoService>();
            _fakedRepoServiceFactory = A.Fake<IRepoServiceFactory>();

            A.CallTo(() => _fakedRepoServiceFactory.ItemRepoService).Returns(_fakedItemRepoService);
            A.CallTo(() => _fakedRepoServiceFactory.BotRepoService).Returns(_fakedBotRepoService);

            _botService = new BotService(_fakedRepoServiceFactory);
        }
Beispiel #2
0
 public OfferService(IRepoServiceFactory factory, ITransactionFactory transactionFactory, ILogServiceFactory logServiceFactory)
 {
     _itemDescRepoServcice = factory.ItemDescriptionRepoService;
     _botRepoService       = factory.BotRepoService;
     _userRepoService      = factory.UserRepoService;
     _itemRepoService      = factory.ItemRepoService;
     _offerRepoService     = factory.OfferTranascrionRepoService;
     _itemInOfferTransactionRepoService = factory.ItemInOfferTransactionRepoService;
     _transactionFactory = transactionFactory;
     _logService         = logServiceFactory.CreateLogger <OfferService>();
     _steamLock          = new TimeSpan(7, 1, 0, 0);
 }
 public RepoServiceFactory
 (
     IBetRepoService betRepoService,
     IItemDescriptionRepoService descriptionRepoService,
     IItemBettedRepoService itemBettedRepoService,
     IUserRepoService userRepoService,
     IMatchRepoService matchRepoService,
     IItemRepoService itemRepoService,
     IBotRepoService botRepoService,
     IItemInOfferTransactionRepoService inOfferTransactionRepoService,
     IOfferTranascrionRepoService offerTranascrionRepoService,
     ISettingRepoService settingRepoService,
     IRakeItemRepoService rakeItemRepoService,
     IStaffRepoService staffRepoService,
     ILevelRepoService levelRepoService,
     IGameModeRepoService gameModeRepoService,
     IJackpotSettingRepo jackpotSettingRepo,
     ICoinFlipMatchRepoService coinFlipMatchRepoService)
 {
     ItemInOfferTransactionRepoService = inOfferTransactionRepoService;
     OfferTranascrionRepoService       = offerTranascrionRepoService;
     SettingRepoService         = settingRepoService;
     RakeItemRepoService        = rakeItemRepoService;
     StaffRepoService           = staffRepoService;
     LevelRepoService           = levelRepoService;
     GameModeRepoService        = gameModeRepoService;
     JackpotSettingRepo         = jackpotSettingRepo;
     CoinFlipMatchRepoService   = coinFlipMatchRepoService;
     BetRepoService             = betRepoService;
     ItemDescriptionRepoService = descriptionRepoService;
     ItemBettedRepoService      = itemBettedRepoService;
     UserRepoService            = userRepoService;
     MatchRepoService           = matchRepoService;
     ItemRepoService            = itemRepoService;
     BotRepoService             = botRepoService;
 }
Beispiel #4
0
        public OfferTransactionServiceTest()
        {
            var fakedItemDescriptionRepoService = A.Fake <IItemDescriptionRepoService>();
            var fakedTransactionFactory         = A.Fake <ITransactionFactory>();
            var fakedRepoServiceFactory         = A.Fake <IRepoServiceFactory>();

            _fakedItemInOfferTransactionRepoService = A.Fake <IItemInOfferTransactionRepoService>();
            _fakedOfferTranascrionRepoService       = A.Fake <IOfferTranascrionRepoService>();
            _fakedUserRepoService = A.Fake <IUserRepoService>();
            _fakedBotRepoService  = A.Fake <IBotRepoService>();
            _fakedItemRepoService = A.Fake <IItemRepoService>();

            _fakedTransactionWrapper = A.Fake <ITransactionWrapper>();

            A.CallTo(() => fakedRepoServiceFactory.ItemInOfferTransactionRepoService).Returns(_fakedItemInOfferTransactionRepoService);
            A.CallTo(() => fakedRepoServiceFactory.OfferTranascrionRepoService).Returns(_fakedOfferTranascrionRepoService);
            A.CallTo(() => fakedRepoServiceFactory.UserRepoService).Returns(_fakedUserRepoService);
            A.CallTo(() => fakedRepoServiceFactory.BotRepoService).Returns(_fakedBotRepoService);
            A.CallTo(() => fakedRepoServiceFactory.ItemDescriptionRepoService).Returns(fakedItemDescriptionRepoService);
            A.CallTo(() => fakedRepoServiceFactory.ItemRepoService).Returns(_fakedItemRepoService);
            A.CallTo(() => fakedTransactionFactory.BeginTransaction()).Returns(_fakedTransactionWrapper);

            _offerMinmalInfo = new OfferStatusRequest
            {
                Bot = new Bot
                {
                    Username = "******",
                    SteamId  = "botSteamId"
                },
                SteamId       = "userSteamId",
                StatusCode    = int.MinValue,
                StatusMessage = "",
                OfferSend     = new OfferStatusOffer
                {
                    SteamOffer = new SteamOffer
                    {
                        ItemsToGive =
                        {
                            new Item {
                                AppId = 730, ContextId = "2", AssetId = "1", MarketHashName = "SomeWeapon1"
                            },
                            new Item {
                                AppId = 730, ContextId = "2", AssetId = "2", MarketHashName = "SomeWeapon1"
                            },
                            new Item {
                                AppId = 730, ContextId = "2", AssetId = "3", MarketHashName = "SomeWeapon2"
                            },
                            new Item {
                                AppId = 730, ContextId = "2", AssetId = "4", MarketHashName = "SomeWeapon3"
                            },
                            new Item {
                                AppId = 730, ContextId = "2", AssetId = "5", MarketHashName = "SomeWeapon4"
                            },
                            new Item {
                                AppId = 730, ContextId = "2", AssetId = "6", MarketHashName = "SomeWeapon2"
                            },
                        },
                        ItemsToReceive =
                        {
                            new Item {
                                AppId = 730, ContextId = "2", AssetId = "11", MarketHashName = "SomeWeapon1"
                            },
                            new Item {
                                AppId = 730, ContextId = "2", AssetId = "12", MarketHashName = "SomeWeapon1"
                            },
                            new Item {
                                AppId = 730, ContextId = "2", AssetId = "13", MarketHashName = "SomeWeapon2"
                            },
                            new Item {
                                AppId = 730, ContextId = "2", AssetId = "14", MarketHashName = "SomeWeapon3"
                            },
                            new Item {
                                AppId = 730, ContextId = "2", AssetId = "15", MarketHashName = "SomeWeapon4"
                            },
                            new Item {
                                AppId = 730, ContextId = "2", AssetId = "16", MarketHashName = "SomeWeapon2"
                            },
                        },
                    }
                }
            };


            var someWeapon1 = new DatabaseModel.ItemDescription("SomeWeapon1", new decimal(11.22), "720", "2", "imgUrl", true, 1);
            var someWeapon2 = new DatabaseModel.ItemDescription("SomeWeapon2", new decimal(45.5), "720", "2", "imgUrl", true, 2);
            var someWeapon3 = new DatabaseModel.ItemDescription("SomeWeapon3", new decimal(78.00), "720", "2", "imgUrl", true, 3);
            var someWeapon4 = new DatabaseModel.ItemDescription("SomeWeapon4", new decimal(5.47), "720", "2", "imgUrl", true, 4);

            A.CallTo(() => fakedItemDescriptionRepoService.FindAsync("SomeWeapon1")).Returns(someWeapon1);
            A.CallTo(() => fakedItemDescriptionRepoService.FindAsync("SomeWeapon2")).Returns(someWeapon2);
            A.CallTo(() => fakedItemDescriptionRepoService.FindAsync("SomeWeapon3")).Returns(someWeapon3);
            A.CallTo(() => fakedItemDescriptionRepoService.FindAsync("SomeWeapon4")).Returns(someWeapon4);

            A.CallTo(() => fakedItemDescriptionRepoService.FindAsync(A <List <string> > ._)).Returns(new List <DatabaseModel.ItemDescription>
            {
                someWeapon1,
                someWeapon2,
                someWeapon3,
                someWeapon4,
            });


            _offerService = new OfferService(fakedRepoServiceFactory, fakedTransactionFactory, A.Dummy <ILogServiceFactory>());
        }
Beispiel #5
0
 public BotManager(RpcSteamListener rpcSteamListener, IRepoServiceFactory factory)
 {
     _botServiceRepo = factory.BotRepoService;
     rpcSteamListener.OnBotStatusChanged += RpcSteamListenerOnOnBotStatusChanged;
 }
Beispiel #6
0
 public BotService(IRepoServiceFactory fakedRepoServiceFactory)
 {
     _itemRepoService = fakedRepoServiceFactory.ItemRepoService;
     _botRepoService  = fakedRepoServiceFactory.BotRepoService;
 }