public void ReturnInstanceOfEnumerable_WithValidaDataIsPassed()
        {
            var townServices = new TownServices(this.townRepoMocked.Object);

            // Act
            var allTownsResult = townServices.GetAllTowns();

            // Assert
            Assert.IsInstanceOf <IEnumerable <Town> >(allTownsResult);
        }
        public void Call_AllMethodFromRepositoryOnce()
        {
            // Arrange
            var townServices = new TownServices(this.townRepoMocked.Object);

            // Act
            townServices.GetAllTowns();

            // Assert
            this.townRepoMocked.Verify(x => x.All, Times.Once);
        }
        public void ReturnQueryable_WithExactNumberOfTowns()
        {
            // Arrange
            var townServices = new TownServices(this.townRepoMocked.Object);

            // Act
            var expectedNumberOfTowns = townServices.GetAllTowns().Count();

            // Assert
            Assert.AreEqual(expectedNumberOfTowns, this.towns.Count());
        }