public void ShouldNotThrowWhenValueIsNull() { // arrange var stronglyTypedId = new IdFor <Order, object>(null); // act Func <string> act = () => stronglyTypedId.ToString(); // assert act.Should().NotThrow(); }
public void ShouldNotBeEqualWithIEntityIdWhenValuesAreDifferent() { // arrange var stronglyTypedId = new IntFor <Order>(Faker.Random.Int()); var anotherStronglyTypedId = new IdFor <Order, int>(Faker.Random.Int()); // act var result = stronglyTypedId.Equals(anotherStronglyTypedId); // assert result.Should().BeFalse(); }
public void ShouldNotBeEqualWhenValuesAreDifferent() { // arrange var stronglyTypedId = new IdFor <Order, Guid>(Guid.NewGuid()); var anotherStronglyTypedId = new IdFor <Order, Guid>(Guid.NewGuid()); // act var result = stronglyTypedId == anotherStronglyTypedId; // assert result.Should().BeFalse(); }
public void ShouldNotBeEqualToNull() { // arrange var targetId = Guid.NewGuid(); var stronglyTypedId = new IdFor <Order, Guid>(targetId); // act var result = stronglyTypedId.Equals(null); // assert result.Should().BeFalse(); }
public void ShouldNotBeEqualWithIEntityIdWhenValuesAreDifferent() { // arrange var stronglyTypedId = new LongFor <Order>(Faker.Random.Long()); var anotherStronglyTypedId = new IdFor <Order, long>(Faker.Random.Long()); // act var result = stronglyTypedId != anotherStronglyTypedId; // assert result.Should().BeTrue(); }
public void ShouldBeEqualWhenIdIsTheSame() { // arrange var targetId = Guid.NewGuid(); var stronglyTypedId = new IdFor <Order, Guid>(targetId); // act var result = stronglyTypedId.Equals(stronglyTypedId); // assert result.Should().BeTrue(); }
public void ShouldProvideValueString() { // arrange var targetId = Guid.NewGuid(); var stronglyTypedId = new IdFor <Order, Guid>(targetId); // act var providedValue = stronglyTypedId.ToString(); // assert providedValue.Should().Be(targetId.ToString()); }
public void ShouldBeEqualWithIEntityIdWhenBothNull() { // arrange IdFor <Order, Guid> stronglyTypedId = null; IEntityId <Order, Guid> anotherStronglyTypedId = null; // act var result = stronglyTypedId != anotherStronglyTypedId; // assert result.Should().BeFalse(); }
public void ShouldNotBeEqualWithIEntityIdWhenValuesAreDifferent() { // arrange var stronglyTypedId = new IdFor <Order, Guid>(Guid.NewGuid()); IEntityId <Order, Guid> anotherStronglyTypedId = new GuidFor <Order>(Guid.NewGuid()); // act var result = stronglyTypedId != anotherStronglyTypedId; // assert result.Should().BeTrue(); }
public void ShouldNotBeEqualWithIEntityIdWhenEntitiesAreDifferent() { // arrange var targetId = Guid.NewGuid(); var stronglyTypedId = new GuidFor <Order>(targetId); var anotherStronglyTypedId = new IdFor <PricePosition, Guid>(targetId); // act var result = stronglyTypedId.Equals(anotherStronglyTypedId); // assert result.Should().BeFalse(); }
public void ShouldBeEqualWithIEntityIdWhenValuesAndEntitiesAreEqual() { // arrange var targetId = Faker.Random.Long(); var stronglyTypedId = new LongFor <Order>(targetId); var anotherStronglyTypedId = new IdFor <Order, long>(targetId); // act var result = stronglyTypedId != anotherStronglyTypedId; // assert result.Should().BeFalse(); }
public void ShouldBeEqualWithIEntityIdWhenValuesAndEntitiesAreEqual() { // arrange var targetId = Faker.Random.Int(); var stronglyTypedId = new IntFor <Order>(targetId); var anotherStronglyTypedId = new IdFor <Order, int>(targetId); // act var result = stronglyTypedId.Equals(anotherStronglyTypedId); // assert result.Should().BeTrue(); }
public void ShouldNotBeEqualWithIEntityIdWhenSecondNull() { // arrange var targetId = Guid.NewGuid(); var stronglyTypedId = new IdFor <Order, Guid>(targetId); IEntityId <Order, Guid> anotherStronglyTypedId = null; // act var result = stronglyTypedId != anotherStronglyTypedId; // assert result.Should().BeTrue(); }
public void ShouldBeEqualWithIEntityIdWhenValuesAndEntitiesAreEqual() { // arrange var targetId = Guid.NewGuid(); var stronglyTypedId = new IdFor <Order, Guid>(targetId); IEntityId <Order, Guid> anotherStronglyTypedId = new GuidFor <Order>(targetId); // act var result = stronglyTypedId != anotherStronglyTypedId; // assert result.Should().BeFalse(); }
public void ShouldBeEqualWhenValuesAndEntitiesAreEqual() { // arrange var targetId = Guid.NewGuid(); var stronglyTypedId = new IdFor <Order, Guid>(targetId); var anotherStronglyTypedId = new IdFor <Order, Guid>(targetId); // act var result = stronglyTypedId.Equals(anotherStronglyTypedId); // assert result.Should().BeTrue(); }
public void ShouldNotProvideSameHashCodeWhenValuesAreDifferent() { // arrange var stronglyTypedId = new IdFor <Order, Guid>(Guid.NewGuid()); var anotherStronglyTypedId = new IdFor <Order, Guid>(Guid.NewGuid()); // act var hashCode1 = stronglyTypedId.GetHashCode(); var hashCode2 = anotherStronglyTypedId.GetHashCode(); // assert hashCode1.Should().NotBe(hashCode2); }
public void ShouldNotBeEqualWithIEntityIdWhenFirstNull() { // arrange IdFor <Order, Guid> stronglyTypedId = null; IEntityId <Order, Guid> anotherStronglyTypedId = new GuidFor <Order>(Guid.NewGuid()); ; // act var result = stronglyTypedId != anotherStronglyTypedId; // assert result.Should().BeTrue(); }
public void ShouldNotProvideSameHashCodeWhenEntitiesAreDifferent() { // arrange var targetId = Guid.NewGuid(); var stronglyTypedId = new IdFor <Order, Guid>(targetId); var anotherStronglyTypedId = new IdFor <PricePosition, Guid>(targetId); // act var hashCode1 = stronglyTypedId.GetHashCode(); var hashCode2 = anotherStronglyTypedId.GetHashCode(); // assert hashCode1.Should().NotBe(hashCode2); }
public void ShouldProvideSameHashCodeWhenValuesAndEntitiesAreEqual() { // arrange var targetId = Guid.NewGuid(); var stronglyTypedId = new IdFor <Order, Guid>(targetId); var anotherStronglyTypedId = new IdFor <Order, Guid>(targetId); // act var hashCode1 = stronglyTypedId.GetHashCode(); var hashCode2 = anotherStronglyTypedId.GetHashCode(); // assert hashCode1.Should().Be(hashCode2); }