示例#1
0
        public void Repository_Get()
        {
            //Arrange
            var id = Guid.NewGuid();

            EventStorage.Get(id, -1, "employees")
            .Returns(
                new List <Event>()
            {
                new EmployeeCreatedEvent(55, "Alejandro", "Molines", new DateTime(1981, 11, 28), "Developer")
            }
                );

            //Act
            var user = _eventRepository.Get <Employee>(id).Result;


            //Assert
            user.EmployeeId.Should().Be(55);
            user.FirstName.Should().Be("Alejandro");
            user.LastName.Should().Be("Molines");
            user.JobTitle.Should().Be("Developer");
            user.DateOfBirth.Should().Be(28.November(1981));
            EventStorage.Received(1).Get(id, -1, "employees");
        }