Beispiel #1
0
        public void GetId_ShouldbeCalledOnce()
        {
            // Arrange
            var provinceService = new ProvincesServices(this.provinceRepoMocked.Object, this.unitOfWork);
            var expectedPro     = new Province()
            {
                ProvinceName = "Sofia", Id = 1
            };
            // Act
            var res = provinceService.GetId("Sofia");

            // Assert
            this.provinceRepoMocked.Verify(x => x.All, Times.Once);
        }
Beispiel #2
0
        public void ReturnExpectedProvince()
        {
            // Arrange
            var provinceService = new ProvincesServices(this.provinceRepoMocked.Object, this.unitOfWork);
            var expectedPro     = new Province()
            {
                ProvinceName = "Sofia", Id = 1
            };

            // Act
            var res = provinceService.GetId("Sofia");

            // Assert
            Assert.AreEqual(expectedPro.Id, res);
        }