public async void Should_CheckVisit_RemainingVisit() { DateTime actualTime = new DateTime(2016, 6, 8, 23, 0, 0); var input = new CheckVisitInput { Latitude = 47.0341535, // Bollwerk Longitude = 15.4141751, UserName = "******", ActualTime = actualTime, IsOut = true }; var member = _memberRepository.FirstOrDefault(x => x.UserName == input.UserName); var output = await _clubAppService.CheckVisit(input); output.IsOut.ShouldBe(true); output.ClubId.ShouldBe(1); }
public async void Should_CheckVisit_DeleteVisit() { DateTime actualTime = new DateTime(2016, 6, 8, 23, 0, 0); var input = new CheckVisitInput { Latitude = 47.041938, // außerhalb Longitude = 15.300563, UserName = "******", ActualTime = actualTime, IsOut = true }; var member = await _memberRepository.FirstOrDefaultAsync(x => x.UserName == input.UserName); var output = await _clubAppService.CheckVisit(input); output.IsOut.ShouldBe(false); output.ClubId.ShouldBeNull(); }
public async void Should_CheckVisit_ChangeVisit() { DateTime actualTime = new DateTime(2016, 6, 8, 23, 0, 0); var input = new CheckVisitInput { Latitude = 47.074637, // Scheinbar Longitude = 15.451033, UserName = "******", ActualTime = actualTime, IsOut = true }; var member = _memberRepository.FirstOrDefaultAsync(x => x.UserName == input.UserName); var output = await _clubAppService.CheckVisit(input); output.ClubId.ShouldBe(2); output.IsOut.ShouldBe(true); //var visits = _clubVisitRepository.GetAll().Where(x => x.MemberId == member.Id && !x.HasLeft && actualTime < x.LeavingDate).ToList(); //visits.Count.ShouldBe(1); //visits.First().ClubId.ShouldBe(2); }