private TestLicenseManagerContext GetDemoContext()
        {
            var context = new TestLicenseManagerContext();

            context.Manufacturers.Add(new Manufacturer {
                ManufacturerId = 1, Name = "Demo Manufacturer 1"
            });
            context.Genres.Add(new Genre {
                GenreId = 1, Name = "Demo Genre 1"
            });
            context.Softwares.Add(new Software {
                SoftwareId = 1, Name = "Demo Software 1", ManufacturerId = 1, GenreId = 1
            });
            context.Softwares.Add(new Software {
                SoftwareId = 2, Name = "Demo Software 2", ManufacturerId = 1, GenreId = 1
            });

            context.Licenses.Add(new License {
                LicenseId = 1, SoftwareId = 1, ActivationKey = "DEMO-KEY1"
            });
            context.Licenses.Add(new License {
                LicenseId = 2, SoftwareId = 1, ActivationKey = "DEMO-KEY2"
            });
            context.Licenses.Add(new License {
                LicenseId = 3, SoftwareId = 2, ActivationKey = "DEMO-KEY3"
            });

            return(context);
        }
        private TestLicenseManagerContext GetDemoContext()
        {
            var context = new TestLicenseManagerContext();

            context.Computers.Add(new Computer
            {
                ComputerId = 1,
                UserId     = "686990B4-3263-4566-9713-27666E894AF3",
                Hostname   = "Demo Computer 1",
                IpAddress  = "127.0.0.1",
                Location   = "Demo Location"
            });
            context.Computers.Add(new Computer
            {
                ComputerId = 2,
                UserId     = "92F7EBC3-9AC1-492F-ADC5-2CFC4348829E",
                Hostname   = "Demo Computer 2",
                IpAddress  = "127.0.0.1",
                Location   = "Demo Location"
            });
            context.Computers.Add(new Computer
            {
                ComputerId = 3,
                UserId     = "686990B4-3263-4566-9713-27666E894AF3",
                Hostname   = "Demo Computer 3",
                IpAddress  = "127.0.0.1",
                Location   = "Demo location"
            });
            return(context);
        }
        private TestLicenseManagerContext GetDemoContext()
        {
            var context = new TestLicenseManagerContext();

            context.Manufacturers.Add(new Manufacturer {
                ManufacturerId = 1, Name = "Manufacturer 1"
            });
            context.Manufacturers.Add(new Manufacturer {
                ManufacturerId = 2, Name = "Manufacturer 2"
            });
            return(context);
        }
        public void DeleteManufacturer_ShouldReturnOk()
        {
            var context = new TestLicenseManagerContext();
            var item    = GetDemoManufacturer();

            context.Manufacturers.Add(item);
            var controller = new ManufacturersController(context);

            var result = controller.DeleteManufacturer(item.ManufacturerId) as OkNegotiatedContentResult <Manufacturer>;

            Assert.IsNotNull(result);
            Assert.AreEqual(item.ManufacturerId, result.Content.ManufacturerId);
        }
        private TestLicenseManagerContext GetDemoContext()
        {
            var context = new TestLicenseManagerContext();

            context.Manufacturers.Add(new Manufacturer {
                ManufacturerId = 1, Name = "DemoManufacturer"
            });
            context.Genres.Add(new Genre {
                GenreId = 1, Name = "Demo Genre 1"
            });
            context.Softwares.Add(new Software {
                SoftwareId = 1, Name = "Demo Software 1", ManufacturerId = 1, Description = "Demo1", GenreId = 1
            });
            context.Softwares.Add(new Software {
                SoftwareId = 2, Name = "Demo Software 2", ManufacturerId = 1, Description = "Demo2", GenreId = 1
            });

            return(context);
        }
        public void DeleteManufacturer_ShouldReturnOk()
        {
            var context = new TestLicenseManagerContext();
            var item = GetDemoManufacturer();
            context.Manufacturers.Add(item);
            var controller = new ManufacturersController(context);

            var result = controller.DeleteManufacturer(item.ManufacturerId) as OkNegotiatedContentResult<Manufacturer>;

            Assert.IsNotNull(result);
            Assert.AreEqual(item.ManufacturerId, result.Content.ManufacturerId);

        }
 private TestLicenseManagerContext GetDemoContext()
 {
     var context = new TestLicenseManagerContext();
     context.Manufacturers.Add(new Manufacturer { ManufacturerId = 1, Name = "Manufacturer 1" });
     context.Manufacturers.Add(new Manufacturer { ManufacturerId = 2, Name = "Manufacturer 2" });
     return context;
 }
        private TestLicenseManagerContext GetDemoContext()
        {
            var context = new TestLicenseManagerContext();
            context.Manufacturers.Add(new Manufacturer { ManufacturerId = 1, Name = "Demo Manufacturer 1" });
            context.Genres.Add(new Genre { GenreId = 1, Name = "Demo Genre 1" });
            context.Softwares.Add(new Software { SoftwareId = 1, Name = "Demo Software 1", ManufacturerId = 1, GenreId = 1 });
            context.Softwares.Add(new Software { SoftwareId = 2, Name = "Demo Software 2", ManufacturerId = 1, GenreId = 1 });

            context.Licenses.Add(new License { LicenseId = 1, SoftwareId = 1, ActivationKey = "DEMO-KEY1" });
            context.Licenses.Add(new License { LicenseId = 2, SoftwareId = 1, ActivationKey = "DEMO-KEY2" });
            context.Licenses.Add(new License { LicenseId = 3, SoftwareId = 2, ActivationKey = "DEMO-KEY3" });

            return context;
        }
        private TestLicenseManagerContext GetDemoContext()
        {
            var context = new TestLicenseManagerContext();
            context.Manufacturers.Add(new Manufacturer { ManufacturerId = 1, Name = "DemoManufacturer" });
            context.Genres.Add(new Genre { GenreId = 1, Name = "Demo Genre 1" });
            context.Softwares.Add(new Software { SoftwareId = 1, Name = "Demo Software 1", ManufacturerId = 1, Description = "Demo1", GenreId = 1 });
            context.Softwares.Add(new Software { SoftwareId = 2, Name = "Demo Software 2", ManufacturerId = 1, Description = "Demo2", GenreId = 1 });

            return context;
        }