public void ExtractReplicaName_should_return_true_on_valid_property_name(string appPropertyName, string expectedReplicaName, string expectedTagKind) { TagsPropertyKey.TryParse(appPropertyName, out var actual).Should().BeTrue(); actual.Should().NotBeNull(); actual.ReplicaName.Should().Be(expectedReplicaName); actual.TagKind.Should().Be(expectedTagKind); }
public static IApplicationInfoProperties SetReplicaTags([NotNull] this IApplicationInfoProperties properties, [NotNull] string replicaName, ReplicaTagKind replicaTagKind, TagCollection tags) { var propertyKey = new TagsPropertyKey(replicaName, replicaTagKind.ToString()); if (properties.GetReplicaKindTags(propertyKey).Equals(tags)) { return(properties); } return(tags?.Count > 0 ? properties.Set(propertyKey.ToString(), tags.ToString()) : properties.Remove(propertyKey.ToString())); }
public void ExtractReplicaName_should_return_false_on_invalid_property_name(string appPropertyName) { TagsPropertyKey.TryParse(appPropertyName, out var actual).Should().BeFalse(); actual.Should().BeNull(); }