Esempio n. 1
0
        public async Task Success_CreateDepartement()
        {
            var command = new CreateDepartementCommand
            {
                Payload = new CreateDepartemenVM {
                    Name     = "Test success name",
                    Location = "Test Success Location"
                }
            };

            var result = await _mediator.Object.Send(command, default);

            Assert.IsType <SuccessResponse>(result);
            Assert.True(result.Success);
        }
Esempio n. 2
0
        public async Task Failed_CreateDepartement()
        {
            // Arrange
            await Success_CreateDepartement();

            var command = new CreateDepartementCommand
            {
                Payload = new CreateDepartemenVM
                {
                    Name     = "Test Success Name",
                    Location = "Test Success Location"
                }
            };

            // Act
            var result = await _mediatr.Object.Send(command, default);

            // Assert
            Assert.IsType <SuccessResponse>(result);
            Assert.False(result.Success);
        }