public void EqualsTest() { var self = Sets[0][RelationNames.Self]; var self2 = new StagePath(1, 2, 3); var self3 = Sets[1][RelationNames.Self]; Assert.True(self.Equals(self)); Assert.True(self.Equals(self2)); Assert.False(self.Equals(self3)); Assert.True(self == self2); Assert.False(self != self2); Assert.False(self == self3); Assert.True(self != self3); Assert.Equal(self, self); Assert.Equal(self, self2); Assert.NotEqual(self, self3); Assert.Equal(self.GetHashCode(), self.GetHashCode()); Assert.Equal(self.GetHashCode(), self2.GetHashCode()); Assert.NotEqual(self.GetHashCode(), self3.GetHashCode()); Assert.NotEqual(self, Sets[0][RelationNames.Ancestor]); Assert.NotEqual(self, Sets[0][RelationNames.Child]); Assert.NotEqual(self, Sets[0][RelationNames.Descendant]); Assert.NotEqual(self, Sets[0][RelationNames.Parent]); }
private static string GetText(StagePath path, object message) { if (path == StagePath.Empty) { return(message.ToString()); } return($"{path} - {message}"); }
public void Write(LogLevels level, StagePath path, object message) { switch (level) { case LogLevels.Error: Log.Error(GetText(path, message)); break; case LogLevels.Fatal: Log.Fatal(GetText(path, message)); break; case LogLevels.Information: Log.Information(GetText(path, message)); break; case LogLevels.Warning: Log.Warning(GetText(path, message)); break; default: throw new Exception($"Unknown LogLevel {level}"); } }