Exemple #1
0
        public void Should_Create_Group_For_Valid_Input_Parameters()
        {
            //ARRANGE
            var issuerId = 100;
            var fixture  = new GroupOperationsHandlerTestsFixture()
                           .SetupUserRepositoryToReturnUserForId(issuerId)
                           .ConfigureSut();

            var request = CreateValidRequest();

            //ACT && ASSERT
            Assert.DoesNotThrow(() => fixture.Sut.CreateNewGroup(request, issuerId));
        }
Exemple #2
0
        public void Should_Throw_Exception_For_Invalid_IssuerId([Values(-1, 0, null)] int invalidIssuerId)
        {
            //ARRANGE
            var fixture = new GroupOperationsHandlerTestsFixture()
                          .ConfigureSut();

            var request = CreateValidRequest();

            //ACT && ASSERT
            var exception = Assert.Throws <Exception>(() => fixture.Sut.CreateNewGroup(request, invalidIssuerId));

            Assert.That(exception.Message, Is.EqualTo($"Could not find entity of type [{typeof(UserEntity).Name}]"));
        }