예제 #1
0
        public void FindMatching_Should_Return_Correct_KnownSource()
        {
            KnownSources.Add(_factory.CreateKnownSource("http://weblogs.asp.net") as KnownSource);

            //database.Setup(db => db.ExecuteQuery<KnownSource>(It.IsAny<string>(), It.IsAny<object[]>())).Returns(new List<KnownSource> { KnownSources[0] }).Verifiable();

            var knownSource = _knownSourceRepository.FindMatching("http://weblogs.asp.net/ScottGu");

            Assert.Equal("http://weblogs.asp.net", knownSource.Url);
        }
        public void Add_Should_Throw_Exception_When_Specified_Url_Already_Exists()
        {
            KnownSources.Add(_factory.CreateKnownSource("http://weblogs.asp.net") as KnownSource);

            Assert.Throws <ArgumentException>(() => _knownSourceRepository.Add(_factory.CreateKnownSource("http://weblogs.asp.net")));
        }