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); }
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)); }
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) { }
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)); }
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")); }
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)" ); }
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)); }
/// <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)); }
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(); }
/// <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; }
public void RandomGuidTest() { GuidProvider.CreateRandom().CastToString().ShouldNotBeEmpty(); }
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; }
public static Guid SequentialAsString() => GuidProvider.Create(GuidStyle.SequentialAsStringStyle);
public static Guid Basic() => GuidProvider.Create(GuidStyle.BasicStyle);
public Guid Create() => Create(GuidProvider.Invoke(), TimestampProvider.Invoke());
public void WhenTheGuidProviderValuePropertyIsRetrieved_ThenAnExceptionIsNotThrown() { Assert.DoesNotThrow(() => _ = new GuidProvider().Value); }
public IdentificationController(GuidProvider provider) { _id = provider.Id; }
public SetGuidMiddleware(RequestDelegate next, GuidProvider guidProvider) { _next = next; _guidProvider = guidProvider; }
/// <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; }
public Guid Create(DateTime timestamp) => Create(GuidProvider.Invoke(), timestamp);
public ObjectDB(StorageEngine storageEngine, Serializer <TGroup> serializer, GuidProvider guidProvider = null) { this.storageEngine = storageEngine; this.serializer = serializer; this.guidProvider = guidProvider ?? (() => Guid.NewGuid()); }
public static Guid SequentialAsBinary() => GuidProvider.Create(GuidStyle.SequentialAsBinaryStyle);
public void WhenTheGuidProviderClassIsInstantiated_ThenAnExceptionIsNotThrown() { Assert.DoesNotThrow(() => _ = new GuidProvider()); }
public static Guid SequentialAsEnd() => GuidProvider.Create(GuidStyle.SequentialAsEndStyle);
public SqlCombProvider(ICombDateTimeStrategy dateTimeStrategy, TimestampProvider customTimestampProvider = null, GuidProvider customGuidProvider = null) : base(dateTimeStrategy, customTimestampProvider, customGuidProvider) { }
public static Guid Equifax() => GuidProvider.Create(GuidStyle.EquifaxStyle);