Esempio n. 1
0
        public void add_awesome_quote_to_samuari()
        {
            var dataAccess = new DataAccess();
            var sam        = new Samurai
            {
                Name   = "Sven",
                Quotes = new List <Quote>()
            };

            dataAccess.Add(sam);
            dataAccess.AddAwesomeQuoteToSamurai("awesomeee", sam);

            dataAccess.ClearContext();
            var result = dataAccess.FindByName("Sven");

            Assert.AreEqual("Sven", result.Name);
            Assert.AreEqual(1, result.Quotes.Count);
            Assert.AreEqual("awesomeee", result.Quotes.First().Text);
        }