Exemple #1
0
 public void StringIdShouldEqualString()
 {
     Aggregates.Id id = "test";
     id.Equals("test").Should().BeTrue();
     (id == (Id)"test").Should().BeTrue();
     (id != (Id)"tt").Should().BeTrue();
 }
Exemple #2
0
 public void LongIdShouldEqualLong()
 {
     Aggregates.Id id = 1L;
     id.Equals(1L).Should().BeTrue();
     (id == (Id)1L).Should().BeTrue();
     (id != (Id)2L).Should().BeTrue();
 }
Exemple #3
0
        public void EntityHasId()
        {
            Aggregates.Id id = "test";
            Inject(id);

            Sut.Id.Should().Be((Aggregates.Id) "test");
        }
Exemple #4
0
        public void TwoIdenticalIdsShouldEqual()
        {
            Aggregates.Id id1 = "test";
            Aggregates.Id id2 = "test";

            id1.Equals(id2).Should().BeTrue();
        }
Exemple #5
0
        public void GuidIdShouldEqualGuid()
        {
            var guid = Guid.NewGuid();

            Aggregates.Id id = guid;
            id.Equals(guid).Should().BeTrue();
            (id == (Id)guid).Should().BeTrue();
            (id != (Id)Guid.NewGuid()).Should().BeTrue();
        }
Exemple #6
0
 public void NullIdShouldEqualNull()
 {
     Aggregates.Id id = (string)null;
     id.Equals(null).Should().BeTrue();
 }
Exemple #7
0
 public void IdShouldNotEqualNull()
 {
     Aggregates.Id id = "test";
     id.Equals(null).Should().BeFalse();
 }
Exemple #8
0
 public void TwoSameIdShouldBeEqual()
 {
     Aggregates.Id id = "test";
     id.Equals(id).Should().BeTrue();
 }
Exemple #9
0
 public void ShouldCreateIdFromLong()
 {
     Aggregates.Id id    = 1L;
     long          test  = id;
     long?         test2 = id;
 }
Exemple #10
0
 public void ShouldCreateIdFromGuid()
 {
     Aggregates.Id id    = Guid.NewGuid();
     Guid          test  = id;
     Guid?         test2 = id;
 }
Exemple #11
0
 public void ShouldCreateIdFromString()
 {
     Aggregates.Id id   = "test";
     string        test = id;
 }
Exemple #12
0
        public void ShouldGetStringWithNullValue()
        {
            var id = new Aggregates.Id(null);

            id.ToString().Should().Be("null");
        }