コード例 #1
0
 protected void GivenThereAreTogglesOnTheProject()
 {
     OriginalProjection.Project.AddToggle(
         DataFixture.Create <Projections.EventAudit>(),
         DataFixture.Create <string>(),
         DataFixture.Create <string>());
 }
コード例 #2
0
 protected void GivenTheProjectionHasStateForAnotherEnvironment()
 {
     OriginalProjection.ToggleState.AddEnvironmentState(
         DataFixture.Create <Projections.EventAudit>(),
         DataFixture.Create <string>(),
         DataFixture.Create <string>());
 }
コード例 #3
0
 private void GivenTheProjectAlreadyHasAToggleState()
 {
     OriginalProjection.EnvironmentState.AddToggleState(
         DataFixture.Create <Projections.EventAudit>(),
         DataFixture.Create <string>(),
         DataFixture.Create <string>());
 }
コード例 #4
0
 protected void GivenAnotherProjectIsOnTheAccount()
 {
     OriginalProjection.Account.AddProject(
         DataFixture.Create <Projections.EventAudit>(),
         DataFixture.Create <Guid>(),
         DataFixture.Create <string>());
 }
コード例 #5
0
ファイル: CommandSpecs.cs プロジェクト: binarymash/evelyn
        private void WhenWeDeleteTheEnvironment()
        {
            UserId = DataFixture.Create <string>();
            var command = new Command(UserId, _projectId, _environmentToDeleteKey, _environmentToDeleteVersion);

            WhenWeHandle(command);
        }
コード例 #6
0
        private void GivenWeHaveCreatedAProject()
        {
            _projectId = DataFixture.Create <Guid>();

            GivenWeHaveCreatedAProjectWith(_projectId);
            _projectVersion = HistoricalEvents.Count - 1;
        }
コード例 #7
0
        protected void GivenTheProjectionExists()
        {
            ProjectId = DataFixture.Create <Guid>();

            OriginalProjection = DataFixture.Create <Projections.ToggleDetails.Projection>();
            ToggleKey          = OriginalProjection.Toggle.Key;
        }
コード例 #8
0
        private void WhenWeRegisterAnAccount()
        {
            UserId = DataFixture.Create <string>();
            var command = new Command(UserId, _accountId);

            WhenWeHandle(command);
        }
コード例 #9
0
 protected void GivenTheProjectionHasOtherToggleStates()
 {
     OriginalProjection.EnvironmentState.AddToggleState(
         DataFixture.Create <Projections.EventAudit>(),
         DataFixture.Create <string>(),
         DataFixture.Create <string>());
 }
コード例 #10
0
 protected void GivenThereAreEnvironmentsOnTheProject()
 {
     OriginalProjection.Project.AddEnvironment(
         DataFixture.Create <Projections.EventAudit>(),
         DataFixture.Create <string>(),
         DataFixture.Create <string>());
 }
コード例 #11
0
        protected void GivenThereAreNoProjections()
        {
            ProjectId = DataFixture.Create <Guid>();
            ToggleKey = DataFixture.Create <string>();

            ProjectionStore.WhenForAnyArgs(ps => ps.Get(Arg.Any <string>()))
            .Do(ci => throw new Evelyn.Core.ReadModel.ProjectionNotFoundException());
        }
コード例 #12
0
        private void GivenOurToggleIsOnTheProjection()
        {
            _toggleKey = DataFixture.Create <string>();

            OriginalProjection.Project.AddToggle(
                DataFixture.Create <Projections.EventAudit>(),
                _toggleKey,
                DataFixture.Create <string>());
        }
コード例 #13
0
        private void GivenOurEnvironmentIsOnTheProjection()
        {
            _environmentKey = DataFixture.Create <string>();

            OriginalProjection.Project.AddEnvironment(
                DataFixture.Create <EventAudit>(),
                _environmentKey,
                DataFixture.Create <string>());
        }
コード例 #14
0
        protected void GivenOurToggleStateIsOnTheProjection()
        {
            ToggleKey = DataFixture.Create <string>();

            OriginalProjection.EnvironmentState.AddToggleState(
                DataFixture.Create <Projections.EventAudit>(),
                ToggleKey,
                DataFixture.Create <string>());
        }
コード例 #15
0
        private void WhenWeAddAnotherToggleWithTheSameName()
        {
            _newToggleKey  = DataFixture.Create <string>();
            _newToggleName = _existingToggleName;

            var command = new Command(UserId, _projectId, _newToggleKey, _newToggleName, _projectVersion);

            WhenWeHandle(command);
        }
コード例 #16
0
ファイル: CommandSpecs.cs プロジェクト: binarymash/evelyn
        private void WhenWeChangeTheToggleState()
        {
            UserId          = DataFixture.Create <string>();
            _newToggleValue = DataFixture.Create <bool>().ToString();

            var command = new Command(UserId, _projectId, _environmentKey, _toggleKey, _newToggleValue, _toggleStateVersion);

            WhenWeHandle(command);
        }
コード例 #17
0
ファイル: HandlerSpecs.cs プロジェクト: binarymash/evelyn
        protected void GivenWeHaveCreatedAProjectWith(Guid id)
        {
            var projectCreated = DataFixture.Create <ProjectCreated>();

            projectCreated.Id      = id;
            projectCreated.Version = HistoricalEvents.Count;

            HistoricalEvents.Add(projectCreated);
        }
コード例 #18
0
        private void WhenWeAddAToggle()
        {
            _newToggleKey  = DataFixture.Create <string>();
            _newToggleName = DataFixture.Create <string>();

            var command = new Command(UserId, _projectId, _newToggleKey, _newToggleName, _projectVersion);

            WhenWeHandle(command);
        }
コード例 #19
0
ファイル: CommandSpecs.cs プロジェクト: binarymash/evelyn
 private void GivenWeHaveAddedAnotherEnvironment()
 {
     _environment2Key = DataFixture.Create <string>();
     HistoricalEvents.Add(new EnvironmentAdded(UserId, _projectId, _environment2Key, DataFixture.Create <string>(), DateTimeOffset.UtcNow)
     {
         Version = HistoricalEvents.Count
     });
     _environment2Version = HistoricalEvents.Count - 1;
 }
コード例 #20
0
        private void GivenWeHaveRegisteredAnAccount()
        {
            _accountId = DataFixture.Create <Guid>();

            HistoricalEvents.Add(new Core.WriteModel.Account.Events.AccountRegistered(UserId, _accountId, DateTimeOffset.UtcNow)
            {
                Version = _accountEventCount
            });
            _accountEventCount++;
        }
コード例 #21
0
ファイル: CommandSpecs.cs プロジェクト: binarymash/evelyn
        private void WhenWeCreateAProjectOnTheAccount()
        {
            UserId       = DataFixture.Create <string>();
            _projectId   = DataFixture.Create <Guid>();
            _projectName = DataFixture.Create <string>();

            var command = new Command(UserId, _accountId, _projectId, _projectName, _accountVersion);

            WhenWeHandle(command);
        }
コード例 #22
0
ファイル: CommandSpecs.cs プロジェクト: binarymash/evelyn
        private void WhenWeAddAnotherProjectWithTheSameId()
        {
            UserId       = DataFixture.Create <string>();
            _projectId   = _existingProjectId;
            _projectName = DataFixture.Create <string>();

            var command = new Command(UserId, _accountId, _existingProjectId, _projectName, _accountVersion);

            WhenWeHandle(command);
        }
コード例 #23
0
ファイル: CommandSpecs.cs プロジェクト: binarymash/evelyn
        private void GivenWeHaveAlreadyCreatedAProject()
        {
            _existingProjectId = DataFixture.Create <Guid>();

            HistoricalEvents.Add(new AccountEvent.ProjectCreated(UserId, _accountId, _existingProjectId, DateTime.UtcNow)
            {
                Version = HistoricalEvents.Count
            });
            _accountVersion++;
        }
コード例 #24
0
ファイル: HandlerSpecs.cs プロジェクト: binarymash/evelyn
        protected void GivenWeHaveAddedAnEnvironmentWith(Guid projectedId, string environmentKey)
        {
            var environmentAdded = DataFixture.Create <EnvironmentAdded>();

            environmentAdded.Id      = projectedId;
            environmentAdded.Key     = environmentKey;
            environmentAdded.Version = HistoricalEvents.Count;

            HistoricalEvents.Add(environmentAdded);
        }
コード例 #25
0
        private async Task WhenWeAddAProject()
        {
            _createProjectMessage = DataFixture.Create <CreateProject>();

            _response = await Client
                        .Request("/management-api/projects/create")
                        .PostJsonAsync(_createProjectMessage).ConfigureAwait(false);

            _responseContent = await _response.Content.ReadAsStringAsync().ConfigureAwait(false);
        }
コード例 #26
0
        private void WhenWeAddAnEnvironment()
        {
            _newEnvironmentKey  = DataFixture.Create <string>();
            _newEnvironmentName = DataFixture.Create <string>();
            UserId = DataFixture.Create <string>();

            var command = new Command(UserId, _projectId, _newEnvironmentKey, _newEnvironmentName, _projectVersion);

            WhenWeHandle(command);
        }
コード例 #27
0
        private void WhenWeAddAnotherEnvironmentWithTheSameName()
        {
            _newEnvironmentKey  = DataFixture.Create <string>();
            _newEnvironmentName = _existingEnvironmentName;
            UserId = DataFixture.Create <string>();

            var command = new Command(UserId, _projectId, _newEnvironmentKey, _newEnvironmentName, _projectVersion);

            WhenWeHandle(command);
        }
コード例 #28
0
ファイル: CommandSpecs.cs プロジェクト: binarymash/evelyn
        private void WhenWeChangeTheValueOfAToggleThatDoesntExist()
        {
            UserId              = DataFixture.Create <string>();
            _toggleKey          = TestUtilities.CreateKey(30);
            _newToggleValue     = DataFixture.Create <bool>().ToString();
            _toggleStateVersion = 0;

            var command = new Command(UserId, _projectId, _environmentKey, _toggleKey, _newToggleValue, _toggleStateVersion);

            WhenWeHandle(command);
        }
コード例 #29
0
ファイル: CommandSpecs.cs プロジェクト: binarymash/evelyn
        private void GivenWeHaveChangedTheToggleState()
        {
            UserId          = DataFixture.Create <string>();
            _newToggleValue = DataFixture.Create <bool>().ToString();

            HistoricalEvents.Add(new ToggleStateChanged(UserId, _projectId, _environmentKey, _toggleKey, _newToggleValue, DateTimeOffset.UtcNow)
            {
                Version = HistoricalEvents.Count
            });
            _toggleStateVersion = HistoricalEvents.Count - 1;
        }
コード例 #30
0
        private void GivenWeHaveAddedAToggle()
        {
            _existingToggleKey  = DataFixture.Create <string>();
            _existingToggleName = DataFixture.Create <string>();

            HistoricalEvents.Add(new ToggleAdded(UserId, _projectId, _existingToggleKey, _existingToggleName, DateTimeOffset.UtcNow)
            {
                Version = HistoricalEvents.Count
            });
            _projectVersion = HistoricalEvents.Count - 1;
        }