public EndConversationArguments(ConversationHandle handle) { if (!handle.HasValue) { throw new ArgumentException("Handle must have a value", nameof(handle)); } ConversationHandle = handle; }
public GetTransmissionStatusArguments(ConversationHandle handle) { if (!handle.HasValue) { throw new ArgumentException("Handle must have a value", nameof(handle)); } ConversationHandle = handle; }
private void CreateOrReuseConversation(int timeOut, int watchDogTimeOut) { switch (LifetimeScope) { case LifetimeScope.ConnectionScope: _processableMessages = CreateDatabaseObjects(timeOut, watchDogTimeOut); break; case LifetimeScope.ApplicationScope: if (ConversationHandle == Guid.Empty || !SqlConnectionProvider.CheckConversationHandler(_connectionString, ConversationHandle.ToString())) { if (ConversationHandle != Guid.Empty) { DropDatabaseObjects(); } _processableMessages = CreateDatabaseObjects(timeOut, watchDogTimeOut); } break; case LifetimeScope.UniqueScope: ConversationHandle = SqlConnectionProvider.GetConversationHandler(_connectionString, GetBaseObjectsNamingConvention()); if (ConversationHandle == Guid.Empty) { _processableMessages = CreateDatabaseObjects(timeOut, watchDogTimeOut); } else { _processableMessages = GetProcessableMessages(); } break; } }
public void SendArguments_RequiresAtLeastOneHandle() { // Arrange var handles1 = default(ConversationHandle[]); var handles2 = new ConversationHandle[0]; // Act Action create1 = () => new SendArguments(); Action create2 = () => new SendArguments(handles1); Action create3 = () => new SendArguments(handles2); // Assert Assert.Throws<ArgumentException>("conversationHandles", create1); Assert.Throws<ArgumentNullException>("conversationHandles", create2); Assert.Throws<ArgumentException>("conversationHandles", create3); }
public void ConversationHandle_HasValue_IsTrue_WhenValueIsNonEmptyGuid() { // Arrange ConversationHandle handle; // Act handle = new ConversationHandle(Guid.NewGuid()); // Assert Assert.Equal(true, handle.HasValue); }
public void ConversationHandle_HasValue_IsFalse_WhenValueIsEmptyGuid() { // Arrange ConversationHandle handle; // Act handle = new ConversationHandle(Guid.Empty); // Assert Assert.Equal(false, handle.HasValue); }
public void ConversationHandle_Constructor_SetsProperties() { // Arrange var guid = Guid.NewGuid(); // Act var handle = new ConversationHandle(guid); // Assert Assert.Equal(guid, handle.Value); }
public void ConversationHandleOrGroupId_HasValue_IsTrue_WhenConversationHandleHasValue() { // Arrange ConversationHandleOrGroupId related; // Act related = new ConversationHandle(Guid.NewGuid()); // Assert Assert.Equal(true, related.HasValue); }
public ConversationHandleOrGroupId(ConversationHandle conversationHandle) { ConversationHandle = conversationHandle; ConversationGroupId = default(ConversationGroupId); }