public TopicAttributes(TopicResource topicResource) { if (topicResource != null) { AccessedAt = topicResource.AccessedAt; AutoDeleteOnIdle = topicResource.AutoDeleteOnIdle; EntityAvailabilityStatus = topicResource.EntityAvailabilityStatus; CreatedAt = topicResource.CreatedAt; CountDetails = topicResource.CountDetails; DefaultMessageTimeToLive = topicResource.DefaultMessageTimeToLive; DuplicateDetectionHistoryTimeWindow = topicResource.DuplicateDetectionHistoryTimeWindow; EnableBatchedOperations = topicResource.EnableBatchedOperations; EnableExpress = topicResource.EnableExpress; EnablePartitioning = topicResource.EnablePartitioning; EnableSubscriptionPartitioning = topicResource.EnableSubscriptionPartitioning; FilteringMessagesBeforePublishing = topicResource.FilteringMessagesBeforePublishing; IsAnonymousAccessible = topicResource.IsAnonymousAccessible; IsExpress = topicResource.IsExpress; MaxSizeInMegabytes = topicResource.MaxSizeInMegabytes; RequiresDuplicateDetection = topicResource.RequiresDuplicateDetection; SizeInBytes = topicResource.SizeInBytes; Status = topicResource.Status; SubscriptionCount = topicResource.SubscriptionCount; SupportOrdering = topicResource.SupportOrdering; UpdatedAt = topicResource.UpdatedAt; Name = topicResource.Name; Id = topicResource.Id; Type = topicResource.Type; Location = topicResource.Location; } }
public void GivenTheTutorCannotFindTheTopicWithName(string name) { // arrange service = new Mock <ITopicService>(); mapper = new Mock <IMapper>(); save = new SaveTopicResource(); TopicResource topicResource = new TopicResource(); topicResource.Name = name; save.Name = name; Topic topic = new Topic(); topic.Name = name; mapper.Setup(r => r.Map <SaveTopicResource, Topic>(save)).Returns(topic); service.Setup(r => r.SaveAsync(id, topic)).ReturnsAsync(new TopicResponse(topic)); mapper.Setup(r => r.Map <Topic, TopicResource>(topic)).Returns(topicResource); _controller = new CourseTopicsController(service.Object, mapper.Object); }
public TopicAttributes GetTopic(string resourceGroupName, string namespaceName, string topicName) { TopicResource response = Client.Topics.Get(resourceGroupName, namespaceName, topicName); return(new TopicAttributes(response)); }