This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'approvals' | |
require 'approvals/rspec' | |
Approvals.configuration.approvals_path = './' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
args: ('foo', -1, 0) => 'foo, -2, 0' | |
args: ('foo', -1, 1) => 'foo, -2, 0' | |
args: ('foo', -1, 49) => 'foo, -2, 47' | |
args: ('foo', -1, 50) => 'foo, -2, 48' | |
args: ('foo', 0, 0) => 'foo, -1, 0' | |
args: ('foo', 0, 1) => 'foo, -1, 0' | |
args: ('foo', 0, 49) => 'foo, -1, 47' | |
args: ('foo', 0, 50) => 'foo, -1, 48' | |
args: ('foo', 11, 0) => 'foo, 10, 0' | |
args: ('foo', 11, 1) => 'foo, 10, 0' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void changeEmail(String newEmail) | |
{ | |
Object[] data = Database.getUserById(userId); | |
email = (String)data[1]; | |
userType = (UserType)data[2]; | |
if (Objects.equals(email, newEmail)) | |
return; | |
Object[] companyData = Database.getCompany(userId); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void changeEmail(String newEmail) | |
{ | |
if (changeEmailInDatabase(newEmail)) return; | |
MessageBus.sendEmailChangedMessage(this.userId, newEmail); | |
} | |
boolean changeEmailInDatabase(String newEmail) { | |
Object[] data = Database.getUserById(userId); | |
email = (String)data[1]; | |
userType = (UserType)data[2]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
record EmailChangedMessage(int userId, String newEmail) implements DomainEvent {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <catch2/catch.hpp> | |
#include "ApprovalTests.hpp" | |
#include "GildedRose.h" | |
std::ostream &operator<<(std::ostream &os, const Item &obj) { | |
return os | |
<< "name: " << obj.name | |
<< ", sellIn: " << obj.sellIn | |
<< ", quality: " << obj.quality; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.gildedrose; | |
import org.approvaltests.Approvals; | |
import org.approvaltests.combinations.CombinationApprovals; | |
import org.approvaltests.reporters.DiffReporter; | |
import org.approvaltests.reporters.UseReporter; | |
import org.junit.jupiter.api.Test; | |
@UseReporter(DiffReporter.class) | |
public class GildedRoseApprovalTest { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import unittest | |
from approvaltests import combination_approvals | |
from gilded_rose import Item, GildedRose | |
class GildedRoseTest(unittest.TestCase): | |
def test_update_quality(self): | |
combination_approvals.verify_all_combinations( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import unittest | |
from approvaltests import combination_approvals | |
from gilded_rose import Item, GildedRose | |
class GildedRoseTest(unittest.TestCase): | |
def test_update_quality(self): | |
combination_approvals.verify_all_combinations( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GildedRoseKata; | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using VerifyXunit; | |
using Xunit; |