Skip to content

Instantly share code, notes, and snippets.

@Eyas
Created May 25, 2020 17:45
Show Gist options
  • Save Eyas/3d7d23f78c1940df460f7d5c9ddf7de3 to your computer and use it in GitHub Desktop.
Save Eyas/3d7d23f78c1940df460f7d5c9ddf7de3 to your computer and use it in GitHub Desktop.
ConcertProto ExpensiveConcert() {
ConcertProto concert;
ArtistProto* artist = concert.mutable_artist();
artist->set_id(kBeyonceId);
artist->set_name("Beyonce");
artist->set_avg_price(200);
concert.set_capacity(500);
return concert;
}
TEST(ConcertTest, ComputesPrice) {
OutcomeProto outcome;
outcome.set_expected(200 * 500);
outcome.set_variance(10_000);
EXPECT_THAT(
ForecastOutcome(ExpensiveConcert()),
EqualsProto(outcome));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment