Beispiel #1
0
        public void DeleteSchema_DeleteSchemaByName()
        {
            // Arrange
            mockSchemaRepository = new Mock<IRepository<Schema>>();
            var list = new List<Schema>()
            {
                new Schema()
                {
                    Id = "1",
                    Data = "Data",
                    Name = "Name"
                },
            };
            mockSchemaRepository.Setup(x => x.Get(It.IsAny<Expression<Func<Schema, bool>>>())).Returns(list);
            var schemaService = new SchemaService(mockSchemaRepository.Object, mapper);
            var schemaName = "Name";

            // Act
            schemaService.DeleteSchema(schemaName);

            // Assert
            mockSchemaRepository.Verify(x => x.Delete(It.IsAny<string>()), Times.Once);
        }