public void DataCleanup_DomainTopicCleanup_NullOrWhitespaceDomainTopicName_ThrowsException(string topicName) { // Setup var dataCleanup = new Functions(_ServiceLayer); string parameters = TestValues.GetQueueMessageData(topicName); Func <Task> act = async() => await dataCleanup.DomainTopicCleanup(parameters); // Act + Verify act.Should().Throw <ArgumentException>().WithMessage("DomainTopicName value is invalid."); }
public async Task DataCleanup_DomainTopicList_ShouldWork() { // Setup var dataCleanup = new Functions(_ServiceLayer); // Act await dataCleanup.DomainTopicList(TestValues.GetQueueMessageData()); // Verify _ServiceLayer.PopulateDomainTopicQueueCalled.Should().BeTrue(); _ServiceLayer.LastParametersPassed.Should().BeEquivalentTo(TestValues.GetDataCleanupParameters()); }
public async Task DataCleanup_DomainTopicCleanup_ShouldWork() { // Setup var dataCleanup = new Functions(_ServiceLayer); string topicName = "domaintopicname"; string parameters = TestValues.GetQueueMessageData(topicName); // Act await dataCleanup.DomainTopicCleanup(parameters); // Verify _ServiceLayer.DeleteDomainTopicCalled.Should().BeTrue(); var expectedParameters = TestValues.GetDataCleanupParameters(); expectedParameters.DomainTopicName = topicName; _ServiceLayer.LastParametersPassed.Should().BeEquivalentTo(expectedParameters); }