예제 #1
0
        private void SetupMetadataItems()
        {
            var guidProvider = new GuidProvider();
            var saveService  = new SaveService(Config);
            var firstMap     = new Dictionary <string, object>()
            {
                { "Bezeichnung", "ok then" },
                { "Typ", "D4C" },
                { "Stichwörter", "kocchi wo miro" }
            };
            var firstItem = new MetadataItem(guidProvider.NextGuid, firstMap);

            saveService.SaveDocument(firstItem);
            var secondMap = new Dictionary <string, object>()
            {
                { "Bezeichnung", "ok then" },
                { "Typ", "Quittung" },
                { "Stichwörter", "some jojo meme" }
            };
            var secondItem = new MetadataItem(guidProvider.NextGuid, secondMap);

            saveService.SaveDocument(secondItem);
            var thirdMap = new Dictionary <string, object>()
            {
                { "Bezeichnung", "My deadly queen has already touched this code" },
                { "Typ", "Crazy Diamond" },
                { "Stichwörter", "ok I guess" }
            };
            var thirdItem = new MetadataItem(guidProvider.NextGuid, thirdMap);

            saveService.SaveDocument(thirdItem);
        }
예제 #2
0
        public SwixModel Parse(string input)
        {
            var stream       = new StringReader(input);
            var guidProvider = new GuidProvider(treatAbsentGuidAsError: false);

            return(SwixParser.Parse(stream, guidProvider));
        }
 public static ScrumTeam CreateScrumTeam(
     string name,
     IEnumerable <Estimation> availableEstimations = null,
     DateTimeProvider dateTimeProvider             = null,
     GuidProvider guidProvider = null)
 {
     return(new ScrumTeam(name, availableEstimations, dateTimeProvider, guidProvider));
 }
예제 #4
0
 public HomeController(ILogger <HomeController> logger,
                       IMessageServiceA messageService,
                       LiteDbConfig liteDbConfig,
                       GuidProvider guidHelper)
 {
     _logger         = logger;
     _messageService = messageService;
     _messageService = new MessageServiceAA();
     _guidHelper     = guidHelper;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AzurePlanningPokerController"/> class.
 /// </summary>
 /// <param name="dateTimeProvider">The date time provider to provide current date-time.</param>
 /// <param name="guidProvider">The GUID provider to provide new GUID objects.</param>
 /// <param name="deckProvider">The provider to get estimation cards deck.</param>
 /// <param name="configuration">The configuration of the planning poker.</param>
 /// <param name="repository">The Scrum teams repository.</param>
 /// <param name="taskProvider">The system tasks provider.</param>
 /// <param name="logger">Logger instance to log events.</param>
 public AzurePlanningPokerController(
     DateTimeProvider dateTimeProvider,
     GuidProvider guidProvider,
     DeckProvider deckProvider,
     IAzurePlanningPokerConfiguration configuration,
     IScrumTeamRepository repository,
     TaskProvider taskProvider,
     ILogger <PlanningPokerController> logger)
     : base(dateTimeProvider, guidProvider, deckProvider, configuration, repository, taskProvider, logger)
 {
 }
예제 #6
0
        public async Task <ActionResult <UserDto> > Register(RegisterUserWithCredentialsRequest request)
        {
            var guid   = GuidProvider.GetGuid();
            var result = await Mediator.Send(new RegisterUserWithCredentialsCommand(
                                                 userGuid : guid,
                                                 email : request.Email,
                                                 displayName : request.DisplayName,
                                                 password : request.Password
                                                 ).WithRequestContext(await GetRequestContext()));

            return(GetResponse(result));
        }
예제 #7
0
        public void Formatting()
        {
            var guidProvider = new GuidProvider();

            Assert.DoesNotThrow(() => Guid.ParseExact(guidProvider.Guid(GuidFormat.DigitsOnly), "N"));
            Assert.DoesNotThrow(() => Guid.ParseExact(guidProvider.Guid(GuidFormat.DigitsWithHyphens), "D"));
            Assert.DoesNotThrow(() =>
                                Guid.ParseExact(guidProvider.Guid(GuidFormat.DigitsWithHyphensWrappedInBrackets), "B"));
            Assert.DoesNotThrow(() =>
                                Guid.ParseExact(guidProvider.Guid(GuidFormat.DigitsWithHyphensWrappedInParentheses), "P"));
            Assert.DoesNotThrow(() =>
                                Guid.ParseExact(guidProvider.Guid(GuidFormat.FourHexadecimalWrappedInBrackets), "X"));
        }
예제 #8
0
        public void IsUnique()
        {
            var guidProvider = new GuidProvider();
            var guids        = new Guid[Assertion.Amount];

            for (var i = 0; i < Assertion.Amount; i++)
            {
                guids[i] = guidProvider.Guid();
            }

            Assert.True(
                guids.GroupBy(x => x).All(x => x.Count() == 1),
                "guids.GroupBy(x => x).All(x => x.Count() == 1)"
                );
        }
예제 #9
0
        private static PlanningPokerController CreatePlanningPokerController(
            DateTimeProvider dateTimeProvider         = null,
            IPlanningPokerConfiguration configuration = null,
            IScrumTeamRepository repository           = null,
            GuidProvider guidProvider = null,
            DeckProvider deckProvider = null,
            TaskProvider taskProvider = null,
            ILogger <PlanningPokerController> logger = null)
        {
            if (logger == null)
            {
                logger = Mock.Of <ILogger <PlanningPokerController> >();
            }

            return(new PlanningPokerController(dateTimeProvider, guidProvider, deckProvider, configuration, repository, taskProvider, logger));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="FileScrumTeamRepository" /> class.
 /// </summary>
 /// <param name="settings">The repository settings.</param>
 /// <param name="configuration">The configuration of the planning poker.</param>
 /// <param name="scrumTeamSerializer">The serializer that provides serialization and desserialization of Scrum Team.</param>
 /// <param name="dateTimeProvider">The date-time provider.</param>
 /// <param name="guidProvider">The GUID provider to provide new GUID objects.</param>
 /// <param name="logger">Logger instance to log events.</param>
 public FileScrumTeamRepository(
     IFileScrumTeamRepositorySettings settings,
     IPlanningPokerConfiguration configuration,
     ScrumTeamSerializer scrumTeamSerializer,
     DateTimeProvider dateTimeProvider,
     GuidProvider guidProvider,
     ILogger <FileScrumTeamRepository> logger)
 {
     _settings            = settings ?? throw new ArgumentNullException(nameof(settings));
     _configuration       = configuration ?? new PlanningPokerConfiguration();
     _scrumTeamSerializer = scrumTeamSerializer ?? new ScrumTeamSerializer(dateTimeProvider, guidProvider, DeckProvider.Default);
     _dateTimeProvider    = dateTimeProvider ?? DateTimeProvider.Default;
     _folder            = new Lazy <string>(GetFolder);
     _invalidCharacters = new Lazy <char[]>(GetInvalidCharacters);
     _logger            = logger ?? throw new ArgumentNullException(nameof(logger));
 }
예제 #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PlanningPokerController" /> class.
 /// </summary>
 /// <param name="dateTimeProvider">The date time provider to provide current date-time.</param>
 /// <param name="guidProvider">The GUID provider to provide new GUID objects.</param>
 /// <param name="deckProvider">The provider to get estimation cards deck.</param>
 /// <param name="configuration">The configuration of the planning poker.</param>
 /// <param name="repository">The Scrum teams repository.</param>
 /// <param name="taskProvider">The system tasks provider.</param>
 /// <param name="logger">Logger instance to log events.</param>
 public PlanningPokerController(
     DateTimeProvider dateTimeProvider,
     GuidProvider guidProvider,
     DeckProvider deckProvider,
     IPlanningPokerConfiguration configuration,
     IScrumTeamRepository repository,
     TaskProvider taskProvider,
     ILogger <PlanningPokerController> logger)
 {
     DateTimeProvider = dateTimeProvider ?? DateTimeProvider.Default;
     GuidProvider     = guidProvider ?? GuidProvider.Default;
     _deckProvider    = deckProvider ?? DeckProvider.Default;
     Configuration    = configuration ?? new PlanningPokerConfiguration();
     Repository       = repository ?? new EmptyScrumTeamRepository();
     _taskProvider    = taskProvider ?? TaskProvider.Default;
     _logger          = logger ?? throw new ArgumentNullException(nameof(logger));
 }
예제 #12
0
 public void GuidCreateTest()
 {
     GuidProvider.Create().CastToString().ShouldNotBeEmpty();
     GuidProvider.Create(CombStyle.NormalStyle).CastToString().ShouldNotBeEmpty();
     GuidProvider.Create(CombStyle.UnixStyle).CastToString().ShouldNotBeEmpty();
     GuidProvider.Create(CombStyle.SqlStyle).CastToString().ShouldNotBeEmpty();
     GuidProvider.Create(CombStyle.LegacySqlStyle).CastToString().ShouldNotBeEmpty();
     GuidProvider.Create(CombStyle.PostgreSqlStyle).CastToString().ShouldNotBeEmpty();
     GuidProvider.Create(GuidStyle.BasicStyle).CastToString().ShouldNotBeEmpty();
     GuidProvider.Create(GuidStyle.TimeStampStyle).CastToString().ShouldNotBeEmpty();
     GuidProvider.Create(GuidStyle.UnixTimeStampStyle).CastToString().ShouldNotBeEmpty();
     GuidProvider.Create(GuidStyle.SqlTimeStampStyle).CastToString().ShouldNotBeEmpty();
     GuidProvider.Create(GuidStyle.LegacySqlTimeStampStyle).CastToString().ShouldNotBeEmpty();
     GuidProvider.Create(GuidStyle.PostgreSqlTimeStampStyle).CastToString().ShouldNotBeEmpty();
     GuidProvider.Create(GuidStyle.CombStyle).CastToString().ShouldNotBeEmpty();
     GuidProvider.Create(GuidStyle.SequentialAsStringStyle).CastToString().ShouldNotBeEmpty();
     GuidProvider.Create(GuidStyle.SequentialAsBinaryStyle).CastToString().ShouldNotBeEmpty();
     GuidProvider.Create(GuidStyle.SequentialAsEndStyle).CastToString().ShouldNotBeEmpty();
     GuidProvider.Create(GuidStyle.EquifaxStyle).CastToString().ShouldNotBeEmpty();
 }
예제 #13
0
 /// <summary>
 ///     <para>
 ///         Creates a <see cref="Configurement" /> with default implementations.
 ///     </para>
 ///     <para>
 ///         Argument <paramref name="random" /> is used by the default implementations.
 ///     </para>
 /// </summary>
 /// <param name="random"></param>
 public Configurement(Random random)
 {
     Random           = random;
     LongProvider     = new LongRandomizer(Random);
     IntProvider      = new IntRandomizer(Random);
     DoubleProvider   = new DoubleRandomizer(Random);
     NameProvider     = new NameByOrigin(Random);
     DateTimeProvider = new DateTimeRandomizer(Random);
     UserNameProvider = new UserNameRandomizer(Random);
     MailProvider     = new UniqueEmailBuilder(
         new[] { "gmail.com", "live.com", "outlook.com", "hotmail.com", "yahoo.com" }
         );
     ListElementPicker      = new ElementRandomizer(Random);
     BoolProvider           = new BoolRandomizer(Random);
     GuidProvider           = new GuidProvider();
     TimeSpanProvider       = new TimeSpanRandomizer(Random);
     DecimalProvider        = new DecimalRandomizer(Random);
     DateTimeOffSetProvider = new DateTimeOffsetRandomizer(Random);
     FloatProvider          = new FloatRandomizer(Random);
     CharProvider           = new CharRandomizer(Random);
 }
 public GreetingsController(IOptions <MySettings> cfg,
                            GuidProvider guidprovider)
 {
     _cfg  = cfg.Value;
     _guid = guidprovider.Id;
 }
예제 #15
0
 public void RandomGuidTest()
 {
     GuidProvider.CreateRandom().CastToString().ShouldNotBeEmpty();
 }
예제 #16
0
 public BaseCombProvider(ICombDateTimeStrategy dateTimeStrategy, TimestampProvider customTimestampProvider = null, GuidProvider customGuidProvider = null)
 {
     if (dateTimeStrategy.NumDateBytes != 4 && dateTimeStrategy.NumDateBytes != 6)
     {
         throw new NotSupportedException("ICombDateTimeStrategy is limited to either 4 or 6 bytes.");
     }
     _dateTimeStrategy      = dateTimeStrategy;
     this.TimestampProvider = customTimestampProvider ?? DefaultTimestampProvider;
     this.GuidProvider      = customGuidProvider ?? Guid.NewGuid;
 }
예제 #17
0
 public static Guid SequentialAsString() => GuidProvider.Create(GuidStyle.SequentialAsStringStyle);
예제 #18
0
 public static Guid Basic() => GuidProvider.Create(GuidStyle.BasicStyle);
예제 #19
0
 public Guid Create() => Create(GuidProvider.Invoke(), TimestampProvider.Invoke());
예제 #20
0
 public void WhenTheGuidProviderValuePropertyIsRetrieved_ThenAnExceptionIsNotThrown()
 {
     Assert.DoesNotThrow(() => _ = new GuidProvider().Value);
 }
 public IdentificationController(GuidProvider provider)
 {
     _id = provider.Id;
 }
예제 #22
0
 public SetGuidMiddleware(RequestDelegate next, GuidProvider guidProvider)
 {
     _next         = next;
     _guidProvider = guidProvider;
 }
예제 #23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ScrumTeamSerializer"/> class.
 /// </summary>
 /// <param name="dateTimeProvider">The date time provider to provide current time. If null is specified, then default date time provider is used.</param>
 /// <param name="guidProvider">The GUID provider to provide new GUID objects. If null is specified, then default GUID provider is used.</param>
 /// <param name="deckProvider">The provider to get default estimation deck.</param>
 public ScrumTeamSerializer(DateTimeProvider dateTimeProvider, GuidProvider guidProvider, DeckProvider deckProvider)
 {
     _dateTimeProvider = dateTimeProvider ?? DateTimeProvider.Default;
     _guidProvider     = guidProvider ?? GuidProvider.Default;
     _deckProvider     = deckProvider ?? DeckProvider.Default;
 }
예제 #24
0
 public Guid Create(DateTime timestamp) => Create(GuidProvider.Invoke(), timestamp);
예제 #25
0
 public ObjectDB(StorageEngine storageEngine, Serializer <TGroup> serializer, GuidProvider guidProvider = null)
 {
     this.storageEngine = storageEngine;
     this.serializer    = serializer;
     this.guidProvider  = guidProvider ?? (() => Guid.NewGuid());
 }
예제 #26
0
 public static Guid SequentialAsBinary() => GuidProvider.Create(GuidStyle.SequentialAsBinaryStyle);
예제 #27
0
 public void WhenTheGuidProviderClassIsInstantiated_ThenAnExceptionIsNotThrown()
 {
     Assert.DoesNotThrow(() => _ = new GuidProvider());
 }
예제 #28
0
 public static Guid SequentialAsEnd() => GuidProvider.Create(GuidStyle.SequentialAsEndStyle);
예제 #29
0
 public SqlCombProvider(ICombDateTimeStrategy dateTimeStrategy, TimestampProvider customTimestampProvider = null, GuidProvider customGuidProvider = null) : base(dateTimeStrategy, customTimestampProvider, customGuidProvider)
 {
 }
예제 #30
0
 public static Guid Equifax() => GuidProvider.Create(GuidStyle.EquifaxStyle);