示例#1
0
            public void AddOrUpdateLocations_Empty()
            {
                _service = new LocationService(_db.Object, _mapper);

                _service.AddOrUpdateLocations(CUSTOMER_ID, new List <LocationData>(), _username).Should().BeEmpty();
                _db.Verify(x => x.SaveChanges(_username), Times.Never);
            }
示例#2
0
            public void AddOrUpdateLocations_Create()
            {
                var locations = new List <LocationData>()
                {
                    new LocationData()
                    {
                        CustomerId   = CUSTOMER_ID,
                        LocationName = "new location"
                    }
                };

                _service = new LocationService(_db.Object, _mapper);

                _service.AddOrUpdateLocations(CUSTOMER_ID, locations, _username).Should().BeSameAs(locations);
                _db.Verify(x => x.SaveChanges(_username), Times.Once);
            }