public void SaveSchema_ShouldCreateNewSchema() { // Arrange mockSchemaRepository = new Mock<IRepository<Schema>>(); var schemaService = new SchemaService(mockSchemaRepository.Object, mapper); var schemaDomain = new SchemaDomain() { Data = "Data", Name = "Name" }; // Act schemaService.SaveSchema("Name", schemaDomain); // Assert mockSchemaRepository.Verify(x => x.Create(It.IsAny<Schema>()), Times.Once); }