Esempio n. 1
0
        public void GetSagaTypesInitiatedBy_Returns_MySaga()
        {
            // Arrange
            var initiatingMessage = new MySagaInitiatingMessage();

            // Act
            var result = NSagaReflection.GetSagaTypesInitiatedBy(initiatingMessage, typeof(NSagaReflectionTests).Assembly);

            // Assert
            result.Should().HaveCount(1).And.Contain(typeof(MySaga));
        }
Esempio n. 2
0
        public void InvokeGenericMethod_Does_NotThrow()
        {
            // Arrange
            var sagaType = NSagaReflection.GetSagaTypesInitiatedBy(new MySagaInitiatingMessage()).First(); // there could be only one!

            var spy          = new RepositorySpy();
            var repository   = new MyStubRepository(spy);
            var expectedGuid = Guid.NewGuid();

            // Act
            NSagaReflection.InvokeGenericMethod(repository, "Find", sagaType, expectedGuid);

            // Assert
            spy.Find.Should().Be(expectedGuid);
        }