コード例 #1
0
        public void GetRandom_Test()
        {
            var municipalities = new[]
            {
                new Municipality {
                    MunicipalityId = "1", Name = "Municipality name 1", DistrictName = "District name 1"
                },
                new Municipality {
                    MunicipalityId = "2", Name = "Municipality name 2", DistrictName = "District name 2"
                },
                new Municipality {
                    MunicipalityId = "3", Name = "Municipality name 3", DistrictName = "District name 3"
                },
                new Municipality {
                    MunicipalityId = "4", Name = "Municipality name 4", DistrictName = "District name 4"
                },
                new Municipality {
                    MunicipalityId = "5", Name = "Municipality name 5", DistrictName = "District name 5"
                },
            };

            var storage    = MemoryDataStorage.FromData(municipalities);
            var repository = new MunicipalityRepository(storage);
            var result     = repository.GetRandom();

            Assert.IsNotNull(result);
        }
コード例 #2
0
    private MunicipalityPopulationProgressModel CreateRandomModel()
    {
        var municipality = MunicipalityRepository.GetRandom();

        return(CreateModelByMunicipality(municipality));
    }