示例#1
0
    public void CountLocationsTest()
    {
        const long LocationCount = 5;
        var        locationsMock = new Mock <IFindFluent <Location, Location> >();

        locationsMock.Setup(x => x.Count(default(CancellationToken))).Returns(LocationCount);
        var repoMock = new Mock <IRepository>();

        repoMock.Setup(repo => repo.GetFluent(It.IsAny <Expression <Func <Location, bool> > >()))
        .Returns(locationsMock.Object);
        var  locationService = new LocationService();
        long result          = locationService.CountLocations(repoMock.Object);

        Assert.AreEqual(LocationCount, result);
    }
 public StatusMessage CountLocationsByRegion(Guid LocTypeKey)
 {
     return(locService.CountLocations(LocTypeKey, n => n.Address.Region));
 }