Esempio n. 1
0
        public void ThenTheExpectedInstanceIsRetrieved()
        {
            var actual = _sut.GetById(_expected.Id.Value);

            Assert.IsNotNull(actual);
            Assert.AreEqual(_expected, actual);
        }
Esempio n. 2
0
        private void AssertDto(SpecialOwnerDto expected)
        {
            var actual = _sut.GetById(expected.Id.Value);

            Assert.IsNotNull(actual);
            Assert.AreEqual(expected, actual);
        }
        public void ThenAnExceptionIsThrown()
        {
            var ids = _expected.Select(x => x.Id.Value).ToList();

            // Add range of non existing items.
            ids.AddRange(new[] { -1L, -1L, -2L, -3L });

            Assert.ThrowsException <ArgumentException>(
                () => _sut.GetById(ids),
                "Not all supplied id's exist.");
        }
        public void ThenTheExpectedInstancesAreRetrieved()
        {
            var ids    = _expected.Select(x => x.Id.Value);
            var actual = _sut.GetById(ids).ToList();

            Assert.AreEqual(_expected.Count, actual.Count);
            foreach (var item in _expected)
            {
                var actualDto = actual.Single(x => x.Id == item.Id);
                Assert.AreEqual(item, actualDto);
            }
        }
Esempio n. 5
0
 public void ThenAnExceptionIsThrown()
 {
     Assert.ThrowsException <ArgumentException>(
         () => _sut.GetById(-1),
         "Not all supplied id's exist.");
 }