Exemplo n.º 1
0
        public void JoinPerformerToFile_PerformerAndFileExist_AddsToJoinTable()
        {
            string dbLocation = @"c:\temp\Files on Dvd.accdb";
            PerformerRepository repository = new PerformerRepository(dbLocation);

            string performerNameToFind  = "steve austin";
            var    performer            = repository.Get(performerNameToFind);
            int    filenameIdToJoinWith = 2;

            repository.JoinPerformerToFile(performer.Id, filenameIdToJoinWith);

            Console.WriteLine("Debug this line");
        }
Exemplo n.º 2
0
        public void Get_ByName_PerformerExists_ReturnsPerformer()
        {
            string dbLocation = @"c:\temp\Files on Dvd.accdb";
            PerformerRepository repository = new PerformerRepository(dbLocation);
            PerformerLocalDto   expected   = new PerformerLocalDto()
            {
                Id   = 177,
                Name = "Steve Austin"
            };

            string performerNameToFind = "steve austin";

            var result = repository.Get(performerNameToFind);

            Assert.AreEqual(expected.Id, result.Id);
        }
Exemplo n.º 3
0
        public void Get_ByName_PerformerDoesNotExist_ReturnsPerformer()
        {
            string dbLocation = @"c:\temp\Files on Dvd.accdb";
            PerformerRepository repository = new PerformerRepository(dbLocation);
            PerformerLocalDto   expected   = new PerformerLocalDto()
            {
                Id   = -1,
                Name = "Oscar the Grouch"
            };

            string performerNameToFind = "oscar the grouch";

            var result = repository.Get(performerNameToFind);

            Assert.AreEqual(expected.Id, result.Id);
        }
Exemplo n.º 4
0
        public void Get_GetAllPerformers_ReturnsAllPerformers()
        {
            string dbLocation = @"c:\temp\Files on Dvd.accdb";
            PerformerRepository repository = new PerformerRepository(dbLocation);
            PerformerLocalDto   expected   = new PerformerLocalDto()
            {
                Id   = 177,
                Name = "Steve Austin"
            };

            List <PerformerLocalDto> performersInDb = repository.Get();

            var result = performersInDb.FirstOrDefault(p => p.Name.ToLower() == "steve austin");

            Assert.AreEqual(expected.Id, result.Id);
        }
Exemplo n.º 5
0
        public void Get_ByName_AliasIsUsed_ReturnsPerformer()
        {
            string dbLocation = @"c:\temp\Files on Dvd.accdb";
            PerformerRepository repository = new PerformerRepository(dbLocation);
            PerformerLocalDto   expected   = new PerformerLocalDto()
            {
                Id   = 177,
                Name = "Steve Austin"
            };

            string performerNameToFind = "chilly mcfreeze";

            var result = repository.Get(performerNameToFind);

            Console.WriteLine("Breakpoint this line");
            Assert.AreEqual(expected.Id, result.Id);
        }