public Task <Guid> Handle(CreateSubcriptionConfigurationCommand request, CancellationToken cancellationToken) { SubscriptionConfiguration configuration = SubscriptionConfiguration.Create(request.SubcriptionId, request.ConfigurationId, request.Enabled); _configurationRepository.Save(configuration); _unitOfWork.Save(); return(Task.FromResult(configuration.Id)); }
public void SubscriptionConfigurationCreatedSuccessfully() { var _subscriptionConfigurationRepository = StartUpTests.ServiceProvider.GetService <ISubscriptionConfigurationRepository>(); Guid configurationId = Guid.NewGuid(); Guid subscriptionId = Guid.NewGuid(); SubscriptionConfiguration subsconfiguration = SubscriptionConfiguration.Create(subscriptionId, configurationId, true); _subscriptionConfigurationRepository.Save(subsconfiguration); StartUpTests.UnitOfWork.Save(); Assert.IsNotNull(subsconfiguration.Id); SubscriptionConfiguration subscriptionConfigurationRead = _subscriptionConfigurationRepository.Find(subsconfiguration.Id); Assert.IsNotNull(subscriptionConfigurationRead); Assert.AreEqual(subscriptionId, subscriptionConfigurationRead.SubcriptionId); Assert.AreEqual(configurationId, subscriptionConfigurationRead.ConfigurationId); Assert.AreEqual(true, subscriptionConfigurationRead.Enabled); }