Example #1
0
        public void FindTest()
        {
            var sniperInfoRepository = new SniperInfoRepository();

            sniperInfoRepository.Increase(new SniperInfo()
            {
                Latitude = 48.830168, Longitude = 2.316475, Id = PokemonId.Poliwrath
            });
            var oldSniperInfo = sniperInfoRepository.Find(new SniperInfo()
            {
                Latitude  = 48.830169,
                Longitude = 2.316475,
                Id        = PokemonId.Poliwrath
            });

            Assert.IsNotNull(oldSniperInfo);
        }
Example #2
0
        public bool AddToRepository(SniperInfo sniperInfo)
        {
            var oldSniperInfo = _sniperInfoRepository.Find(sniperInfo);

            if (oldSniperInfo != null)
            {
                if (sniperInfo.ChannelInfo != null && sniperInfo.ChannelInfo.server == Constants.Bot)
                {
                    AddCaptureExisting(oldSniperInfo, sniperInfo);
                }
                else
                {
                    AddDuplicateDiscovery(oldSniperInfo, sniperInfo);
                }
                return(false);
            }
            else
            {
                AddNew(sniperInfo);
                return(true);
            }
        }