Ejemplo n.º 1
0
        public static Task CreateInvalidFormat()
        {
            var connectionString = ConnectivityService.GetConnectionString("TEMP");
            var context = new BookOrganizer2DbContext(connectionString);
            var repository = new FormatRepository(context);
            var formatService = new FormatService(repository);

            var formatId = new FormatId(SequentialGuid.NewSequentialGuid());
            var command = new Commands.Create { Id = formatId };

            return formatService.Handle(command);
        }
Ejemplo n.º 2
0
        public static async Task<Format> CreateValidFormat()
        {
            var connectionString = ConnectivityService.GetConnectionString("TEMP");
            var context = new BookOrganizer2DbContext(connectionString);
            var repository = new FormatRepository(context);

            var formatService = new FormatService(repository);

            var command = new Commands.Create
            {
                Id = new FormatId(SequentialGuid.NewSequentialGuid()),
                Name = "paperback"
            };

            await formatService.Handle(command);
            return await repository.GetAsync(command.Id);
        }