public void ShouldntWriteAnythingWhenEmptyTagListIsGiven() { var options = InMemoryHelpers.CreateOptions("ShouldntWriteAnythingWhenEmptyTagListIsGiven"); using (var context = new NexusContext(options)) { var tags = Enumerable.Empty <string>(); AddTagsCommand command = new AddTagsCommand(context, tags); command.Execute(); } using (var context = new NexusContext(options)) { var tags = context.Tags.ToList(); Assert.False(tags.Any()); } }
public void CanWriteMoreThanOneTag() { var options = InMemoryHelpers.CreateOptions("CanWriteMoreThanOneTag"); using (var context = new NexusContext(options)) { var tags = GetTags(3); AddTagsCommand command = new AddTagsCommand(context, tags); command.Execute(); } using (var context = new NexusContext(options)) { var tags = context.Tags.ToList(); Assert.True(tags.Count == 3); } }