public void GetAll_AllIntegrationTypesReturned_CountEqualsActual()
        {
            const int expectedCount = 3;
            int       actualCount;

            using (var integrationTypeRepo = new IntegrationTypeRepository(new brothershipEntities(ConnectionStrings.TEST_CONNECTION_STRING_NAME)))
            {
                actualCount = integrationTypeRepo.GetAll().Count();
            }

            Assert.AreEqual(expectedCount, actualCount);
        }
        public void DeleteById_WasDeleted_ActualDataIsNull()
        {
            var             typeIdToDelete = AddandGetTestIntegrationType().ID;
            IntegrationType actualIntegrationType;

            using (var integrationTypeRepo = new IntegrationTypeRepository(new brothershipEntities(ConnectionStrings.TEST_CONNECTION_STRING_NAME)))
            {
                integrationTypeRepo.Delete(typeIdToDelete);
                integrationTypeRepo.SaveChanges();
                actualIntegrationType = integrationTypeRepo.GetById(typeIdToDelete);
            }

            Assert.IsNull(actualIntegrationType);
        }
        public void GetById_CorrectDataGot_ActualEqualsExpectedData()
        {
            var expectedIntegrationType = new IntegrationType
            {
                ID          = 1,
                Description = "Twitch"
            };
            IntegrationType actualIntegrationType;

            using (var integrationTypeRepo = new IntegrationTypeRepository(new brothershipEntities(ConnectionStrings.TEST_CONNECTION_STRING_NAME)))
            {
                actualIntegrationType = integrationTypeRepo.GetById(expectedIntegrationType.ID);
            }

            AssertIntegrationTypesEqual(expectedIntegrationType, actualIntegrationType);
        }
        private IntegrationType AddandGetTestIntegrationType()
        {
            var integrationType = new IntegrationType
            {
                ID          = 2,
                Description = "TestType"
            };

            using (var integrationTypeRepo = new IntegrationTypeRepository(new brothershipEntities(ConnectionStrings.TEST_CONNECTION_STRING_NAME)))
            {
                integrationTypeRepo.Add(integrationType);
                integrationTypeRepo.SaveChanges();
            }

            return(integrationType);
        }
        public void Add_ActualAddedData_EqualsExpectedData()
        {
            var expectedIntegrationType = new IntegrationType
            {
                Description = "Beam"
            };
            IntegrationType actualIntegrationType;

            using (var integrationTypeRepo = new IntegrationTypeRepository(new brothershipEntities(ConnectionStrings.TEST_CONNECTION_STRING_NAME)))
            {
                integrationTypeRepo.Add(expectedIntegrationType);
                integrationTypeRepo.SaveChanges();
                actualIntegrationType = integrationTypeRepo.GetById(expectedIntegrationType.ID);
            }

            AssertIntegrationTypesEqual(expectedIntegrationType, actualIntegrationType);
        }