public void GraphId_Equals_Fails_When_Passsing_Null_Object() { var id = new GraphId(); object x = null; Assert.False(id.Equals(x)); }
public void NotEqualsOperator_AgainstObject(string value1, object value2, bool isSuccess) { var id1 = new GraphId(value1); Assert.AreEqual(isSuccess, id1 != value2); Assert.AreEqual(isSuccess, value2 != id1); }
public void GraphId_Equals_Fails() { var id = new GraphId(); var other = new GraphId(); Assert.False(id.Equals(other)); }
public void GraphId_LogicalNotEqualsOp_Fails_When_lhs_Set_To_Null() { GraphId lhs = null; GraphId rhs = new GraphId(); Assert.True(lhs != rhs); }
public void GraphId_LogicalEqualsOp_Fails_When_rhs_Set_To_Null() { GraphId lhs = new GraphId(); GraphId rhs = null; Assert.False(lhs == rhs); }
public void GraphId_LogicalNotEqualsOp_Works() { GraphId lhs = new GraphId(); GraphId rhs = new GraphId(); Assert.True(lhs != rhs); }
public void GraphId_Equals_Works_For_Same_Object() { var id = new GraphId(); var idObj = (object)id; Assert.That(id.Equals(idObj), Is.EqualTo(true)); }
public void GraphId_New_Works_When_Value_Set_To(string expected) { var value = Guid.Parse(expected); var id = new GraphId(value); Assert.That(id.Value, Is.EqualTo(value.ToUlong())); }
public void EqualsMethodAgainstOtherIdAsObject_Matches() { var id = new GraphId("abc"); var secondId = new GraphId("abc"); Assert.IsTrue(id.Equals((object)secondId)); }
public void EqualsMethodAgainstGraphId_Matches() { var id = new GraphId("abc"); var id2 = new GraphId("abc"); Assert.IsTrue(id.Equals(id2)); }
public void New_Works_When_Using_Custom_Comparer() { GraphId id = new GraphId(); IEqualityComparer <int> comparer = new CustomIntEqualityComparer(); Assert.That(() => new Graph <int>(id, comparer), Throws.Nothing); }
public void StringImplicitCast_IsSuccessful() { GraphId id = new GraphId("abc"); string str = id; Assert.AreEqual("abc", str); }
public void GraphId_LogicalEqualsOp_Works() { GraphId lhs = new GraphId(); GraphId rhs = new GraphId(); Assert.False(lhs == rhs); }
public void GraphId_LogicalNotEqualsOp_Works_For_Equal_References() { GraphId x = new GraphId(); #pragma warning disable 1718 Assert.False(x != x); #pragma warning restore 1718 }
public void ConstructorFromGraphId_YieldsIdValueThatMatches() { var id = new GraphId("abc"); var newId = new GraphId(id); Assert.AreEqual(id.Value, newId.Value); }
public void EqualsMethodAgainstNonString_DoesNotMatch() { var id = new GraphId("abc"); var idValue = (object)123; Assert.IsFalse(id.Equals(idValue)); }
public void GraphId_CompareTo_Works_When_Value_Set_To(string expected) { var value = Guid.Parse(expected); var id = new GraphId(value); var other = new GraphId(value); Assert.True(id.CompareTo(other) == 0); }
public void GraphId_CompareTo_Works() { var id = new GraphId(); var other = new GraphId(); Assert.That(id, Is.Not.EqualTo(other)); Assert.That(id.Value, Is.Not.EqualTo(other.Value)); }
public void EqualsMethodAgainstStringObject_Matches() { var id = new GraphId("abc"); var obj = (object)"abc"; Assert.IsTrue(id.Equals(obj)); }
public void NotEqualsOperatorAgainstSelf_IsFalse() { var id = new GraphId("123"); #pragma warning disable CS1718 // Comparison made to same variable Assert.IsFalse(id != id); #pragma warning restore CS1718 // Comparison made to same variable }
public void NotEqualsOperator(string value1, string value2, bool isSuccess) { var id1 = new GraphId(value1); var id2 = new GraphId(value2); Assert.AreEqual(isSuccess, id1 != id2); Assert.AreEqual(isSuccess, id2 != id1); }
public void GeneralPropertyCheck() { var id = new GraphId("abc"); Assert.AreEqual("abc", id.Value); Assert.AreEqual("abc", id.ToString()); Assert.AreEqual("abc".GetHashCode(), id.GetHashCode()); }
public void EqualsOperatorWithNullValueAgaintNullObject_IsFalse() { var id = new GraphId(null); object obj = null; Assert.IsFalse(id == obj); }
public void EqualsOperatorAgainstSelf_IsTrue() { var id = new GraphId("123"); // ReSharper disable once EqualExpressionComparison #pragma warning disable CS1718 // Comparison made to same variable Assert.IsTrue(id == id); #pragma warning restore CS1718 // Comparison made to same variable }
public void GraphId_Equals_Works_When_Value_Set_To(string expected) { var value = Guid.Parse(expected); var id = new GraphId(value); var other = new GraphId(value); Assert.True(id.Equals(other)); Assert.That(id.Value, Is.EqualTo(other.Value)); Assert.That(id.GetHashCode(), Is.EqualTo(other.GetHashCode())); }
/// <summary> /// Create a new graph using the given GraphId. /// </summary> /// <param name="GraphId">An optional GraphId.</param> /// <param name="Graph">A optional Graph.</param> public GeraGraph CreateGraph(GraphId GraphId = null, GeraGraph Graph = null) { if (GraphId == null) GraphId = GraphId.NewGraphId; if (Graph == null) Graph = new GeraGraph(GraphId); _Graphs.Add(GraphId, Graph); return Graph; }
public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hash = 17; hash = hash * 29 + ScriptId.GetHashCode(); hash = hash * 29 + Handle.GetHashCode(); hash = hash * 29 + NodeId.GetHashCode(); hash = hash * 29 + GraphId.GetHashCode(); return(hash); } }
public async Task <IGraphActionResult> RetrieveHuman([FromGraphQL("id")] GraphId humanId) { var human = await _starWarsData.RetrieveHuman(humanId).ConfigureAwait(false); return(this.Ok(human)); }
public async Task <IGraphActionResult> RetrieveDroid([FromGraphQL("id")] GraphId droidId) { var droid = await _starWarsData.RetrieveDroid(droidId).ConfigureAwait(false); return(this.Ok(droid)); }
public void EqualsMethodAgainstSelfAsObject_Matches() { var id = new GraphId("abc"); Assert.IsTrue(id.Equals((object)id)); }
/// <summary> /// Checks if a Graph having the given GraphId already exists. /// </summary> /// <param name="GraphId">An GraphId.</param> public Boolean HasGraph(GraphId GraphId) { if (GraphId != null) return _Graphs.ContainsKey(GraphId); return false; }
public void EqualsMethodAgainstNullAsObject_DoesNotMatch() { var id = new GraphId("abc"); Assert.IsFalse(id.Equals(null)); }
/// <summary> /// Removes the Graph having the given GraphId. /// </summary> /// <param name="GraphId">An GraphId.</param> public Boolean RemoveGraph(GraphId GraphId) { if (GraphId != null) return _Graphs.Remove(GraphId); return false; }
/// <summary> /// Return a specific graph. /// </summary> /// <param name="GraphId">The GraphId.</param> /// <param name="Graph">The Graph.</param> public Boolean TryGetGraph(GraphId GraphId, out GeraGraph Graph) { if (GraphId != null) return _Graphs.TryGetValue(GraphId, out Graph); Graph = null; return false; }