예제 #1
0
        public static void CanConfigurePreviewUrls(ConfigurePreviewUrls command)
        {
            Guard.NotNull(command, nameof(command));

            Validate.It(() => "Cannot configure preview urls.", error =>
            {
                if (command.PreviewUrls == null)
                {
                    error("Preview Urls is required.", nameof(command.PreviewUrls));
                }
            });
        }
예제 #2
0
        public static void CanConfigurePreviewUrls(ConfigurePreviewUrls command)
        {
            Guard.NotNull(command, nameof(command));

            Validate.It(e =>
            {
                if (command.PreviewUrls == null)
                {
                    e(Not.Defined(nameof(command.PreviewUrls)), nameof(command.PreviewUrls));
                }
            });
        }
예제 #3
0
        public async Task ConfigurePreviewUrls_should_create_events_and_update_state()
        {
            var command = new ConfigurePreviewUrls
            {
                PreviewUrls = new Dictionary<string, string>
                {
                    ["Web"] = "web-url"
                }
            };

            await ExecuteCreateAsync();

            var result = await sut.ExecuteAsync(CreateCommand(command));

            result.ShouldBeEquivalent(sut.Snapshot);

            Assert.Equal(command.PreviewUrls, sut.Snapshot.SchemaDef.PreviewUrls);

            LastEvents
                .ShouldHaveSameEvents(
                    CreateEvent(new SchemaPreviewUrlsConfigured { PreviewUrls = command.PreviewUrls })
                );
        }
예제 #4
0
 public void ConfigurePreviewUrls(ConfigurePreviewUrls command)
 {
     RaiseEvent(command, new SchemaPreviewUrlsConfigured());
 }
예제 #5
0
 private void ConfigurePreviewUrls(ConfigurePreviewUrls command)
 {
     Raise(command, new SchemaPreviewUrlsConfigured());
 }
예제 #6
0
 public void ConfigurePreviewUrls(ConfigurePreviewUrls command)
 {
     RaiseEvent(SimpleMapper.Map(command, new SchemaPreviewUrlsConfigured()));
 }