Пример #1
0
        public void TestGetTitle()
        {
            Record r1 = new Record("Last Christmas", "Wham!", 265, 1984);
            Record r2 = new Record("Last Resort", "Papa Roach", 200, 2000);

            controller.Post(r1);
            controller.Post(r2);

            Assert.AreEqual(1, controller.GetByTitle("last christ").Count);
            Assert.AreEqual(2, controller.GetByTitle("last").Count);
        }
Пример #2
0
        public void TestGetRecordByTitle()
        {
            var controller = new RecordsController();

            var result = controller.GetByTitle("Castle of Glass");

            Assert.AreEqual("Castle of Glass", result.Title);
            Assert.AreEqual("Linkin Park", result.Artist);
        }
        public void TestSearchByTitle()
        {
            IEnumerable <Record> titleList = recordsController.GetByTitle("Hej");
            Record testRecord = new Record();

            foreach (var record in titleList)
            {
                testRecord = record;
            }
            Assert.AreEqual("Hej", testRecord.Title);
        }
Пример #4
0
        public void GetByTitleTest()
        {
            // arrange
            // i BeforeAllTest

            // action
            List <record> recordList = new List <record>(rntr.GetByTitle("hello"));


            // assert
            Assert.AreEqual(1, recordList.Count);
            Assert.AreEqual("hello", recordList[0].Title);
        }