public void CanCompare_AgainstFeatureId() { // Arrange var moduleId = new ModuleId("module"); var id = new FeatureId(moduleId, "feature"); // Act int compare0 = id.CompareTo(FeatureId.Empty); int compare1 = id.CompareTo(new FeatureId(moduleId, "feature")); int compare2 = id.CompareTo(new FeatureId(moduleId, "zzzz")); int compare3 = id.CompareTo(new FeatureId(moduleId, "aaaa")); // Assert Assert.True(1 == compare0); Assert.True(0 == compare1); Assert.True(-1 == compare2); Assert.True(1 == compare3); }
public void CanCompare_AgainstString() { // Arrange var moduleId = new ModuleId("module"); var id = new FeatureId(moduleId, "feature"); // Act int compare0 = id.CompareTo((string)null); int compare1 = id.CompareTo("module.feature"); int compare2 = id.CompareTo("module.zzzz"); int compare3 = id.CompareTo("module.aaaa"); // Assert Assert.True(1 == compare0); Assert.True(0 == compare1); Assert.True(-1 == compare2); Assert.True(1 == compare3); }
public void WhenComparing_UsesCaseInsensitiveCompare() { // Arrange var moduleId = new ModuleId("module"); string value = "feature"; var id = new FeatureId(moduleId, value); // Act int compare = id.CompareTo("MODULE.FEATURE"); // Assert Assert.Equal(0, compare); }