private ToggleValueDbEntity ConvertToDbEntity(ClientApplicationToggleValue businessEntity)
        {
            ToggleValueDbEntity dbEntity = new ToggleValueDbEntity()
            {
                Id = businessEntity.Id,
                ApplicationCodeName = businessEntity.Application.CodeName,
                ApplicationVersion  = businessEntity.Application.Version,
                ToggleId            = businessEntity.ToggleId,
                Value = businessEntity.Value
            };

            return(dbEntity);
        }
        private ClientApplicationToggleValue CreateClientApplicationToggleValue()
        {
            var toggleValue = new ClientApplicationToggleValue()
            {
                Application = new ClientApplication()
                {
                    CodeName = "TestApp",
                    Version  = "1.0"
                },
                Value = true
            };

            return(toggleValue);
        }
Beispiel #3
0
        private int SetupToggleValuesChanges(
            MockOfIClientApplicationToggleValuesRepository mockOfIClientApplicationToggleValuesRepository,
            IList <ToggleDbEntity> mockedToggleDbEntitiesInDbContext)
        {
            IList <ToggleValueDbEntity> mockedToggleValueDbEntities =
                mockedToggleDbEntitiesInDbContext[0].Values.ToList();
            ClientApplicationToggleValue updatedToggleValue =
                this.ConvertToBusinessEntity(mockedToggleValueDbEntities[0]);
            ClientApplicationToggleValue deletedToggleValue =
                this.ConvertToBusinessEntity(mockedToggleValueDbEntities[1]);

            mockOfIClientApplicationToggleValuesRepository.Object.Update(updatedToggleValue);
            mockOfIClientApplicationToggleValuesRepository.Object.Delete(deletedToggleValue);
            return(mockOfIClientApplicationToggleValuesRepository.NumberOfChanges);
        }
Beispiel #4
0
        private ClientApplicationToggleValue ConvertToBusinessEntity(ToggleValueDbEntity toggleValueDbEntity)
        {
            var toggleValue = new ClientApplicationToggleValue()
            {
                Id          = toggleValueDbEntity.Id,
                ToggleId    = toggleValueDbEntity.ToggleId,
                Value       = toggleValueDbEntity.Value,
                Application = new ClientApplication()
                {
                    CodeName = toggleValueDbEntity.ApplicationCodeName,
                    Version  = toggleValueDbEntity.ApplicationVersion
                }
            };

            return(toggleValue);
        }
Beispiel #5
0
 private bool ExistsWithSameId(ClientApplicationToggleValue appToggleValue)
 {
     return(this.originalExistingToggle.Values.Any(tv => tv.Id == appToggleValue.Id));
 }