Exemple #1
0
        public void LoadModule_Should_Return_Call_LoadStream_On_EventStore()
        {
            // Arrange
            _eventStoreMock
            .Setup(store => store.LoadStream(It.IsAny <string>()))
            .Returns(new EventStream("module:testid", 3, new[]
            {
                new ModuleGecreeerd
                {
                    ModuleCode     = "IOPR",
                    ModuleNaam     = "Object georienteerd programeren",
                    AantalEc       = 3,
                    Cohort         = "2019/2020",
                    Studiefase     = new Studiefase("", new List <int>()),
                    Competenties   = new Matrix(),
                    Eindeisen      = new List <string>(),
                    VerplichtVoor  = new List <Specialisatie>(),
                    AanbevolenVoor = new List <Specialisatie>()
                }
            }));
            var repository = new ModuleRepository(_eventStoreMock.Object, _eventPublisherMock.Object);

            // Act
            var result = repository.LoadModule("testid");

            // Assert
            _eventStoreMock.Verify(store => store.LoadStream("module:testid"));
        }