public void DeleteUser_WhenUserExists_ShouldDeleteUser() { IDataGateway gateway = Substitute.For <IDataGateway>(); var repository = new UserRepository(gateway); repository.DeleteUser(2); gateway.Received().RemoveUser(Arg.Any <int>()); }
public void InsertSnippet_WhenSnippetToInsert_ShouldInsertOnce() { IDataGateway gateway = Substitute.For <IDataGateway>(); var repository = new SnippetRepository(gateway); repository.InsertSnippet(new Snippet()); gateway.Received(1).InsertSnippet(Arg.Any <Snippet>()); }
public void InsertUser_WhenUserToInsert_ShouldInsertOnce() { IDataGateway gateway = Substitute.For <IDataGateway>(); var repository = new UserRepository(gateway); repository.InsertUser(new User()); gateway.Received(1).InsertUser(Arg.Any <User>()); }
public void DeleteSnippet_WhenSnippetExists_ShouldDeleteSnippet() { IDataGateway gateway = Substitute.For <IDataGateway>(); var repository = new SnippetRepository(gateway); repository.DeleteSnippet(2); gateway.Received().RemoveSnippet(Arg.Any <int>()); }