Letters From The Engine Room: TOTD Unit Testing CartHelper



TOTD stands for think of the developer and I feel its something that the commerce team should have as an objective. As a company, we are new to Episerver Commerce but it seems that we have to do way too much work to unit test our commerce code. This article will describe how we went about unit testing update quantity cart code. So lets look at the code to update the quantity of an item in the basket.

var lineItem = CartHelper
                .LineItems
                .FirstOrDefault(l => l.CatalogEntryId == skuId);

if (lineItem == null)
    return;

lineItem.Quantity = quantity;  
CartHelper.AcceptChanges();

Ok, so we need to mock CartHelper, but its a static method, so we need to write a cart wrapper and inject that into the class we want to test.

Up to 85% off Cubetractor and other Digerati titles this week




One of the best things about being a PC gamer is the vast variety available to us. There's a veritable smorgasbord of awesome games to be had, and plenty of excellent little indie titles to be found off of the beaten track of triple-A.

Which brings us on to Digerati: a small team that delight in making cracking games built upon deceptively simple mechanisms that hook you early and then never let go. We're currently running a promotion on their products for the next week that'll nab you up you 85% of of the quirky delights of Battlepaths and co. so it's well worth jumping in and giving them a look if you haven't already.

Cubetractor is a particular personal favourite - a nifty little puzzler that's a weird and wonderful action/strategy/puzzle hybrid. Imagine what you'd get if you crossed Plants vs Zombies with elements of bullet hell SHMUPs, and threw in a bunch of tractor beams. Its cuteness will lull you into a false sense of security, but make no mistake, this is a hardcore little gem.

Check out the full list of bargains below:

Let us know if you pick any of them up!

Fuzzy_Pixels

VIP is back! Mortal Kombat X, Evolve, Arkham Knight and more




The VIP page is back, baby, and we've got some seriously sweet games lined up for our loyal customers. From Babealities to Batman, from monster hunting to conquering the New World, we've got another fat slice of discount brilliance.

Company of Heroes 2 deal - up to 75% off for the next 24 hours




How do you follow up what is arguably the best RTS ever made? Wait seven years and then go one better, that's how!

Company of Heroes 2 lets players flex their strategic muscles on the Eastern Front of the Second World War. The year is 1941, the harsh winter is setting in, and the Soviet Red Army finds itself entrenched in brutal frontline warfare to free Mother Russia from the Nazi invaders.

If excellent RTS gameplay is your jam, you might be interested to know that we've got 75% off on the base version of Company of Heroes 2, and 66% off on the expansions for the next 24 hours:

Who do you prefer to play as when it comes to the multiplayer?

Fuzzy_Pixels

Super Chain Crusher Horizon - Playfire Rewards Monday


Games that take classic concepts and evolve them with new gameplay ideas are always worth investigating and in the case of Super Chain Crusher Horizon there's a number of reasons why you should check it out.  Least of all because its capable running in ultra-widescreen 3200x800.  But there's also a host of tweaks and evolutions to the side-scrolling sci-fi shooter concept that brings new joys to the format.  What's more, its 50% OFF over at GMG and we've got a six-shooter of Rewards up against it for the next week too!  Pew-pew-pew-pew!


With over three million Rewards delivered to-date, Playfire has provided a lot of people with cheaper games. If you haven't tried the Playfire Rewards Beta and want to participate, it's easy, just log into Playfire with your Green Man Gaming email address and password and link your Steam account to play your way to cheaper games! For more information check out our FAQ.

Do 61% of gamers prefer singleplayer games? The GMG Winter Survey results are in!



The results of the GMG Winter Survey are in (check out the full infographic right here), and they've yielded some very interesting results indeed. For example, do you spend over seven hours a week gaming? Well, you're not alone! Over 75% of the GMG faithful do exactly the same.

There are other cool little facts and figures too, such as how over a quarter of our audience are regular cinema goers, how 78% of those polled don't play games across multiple devices, and how IGN and PC Gamer came out on top in our survey of games sites visited in the previous month.

But perhaps one of the most interesting stats centres around the following question: What type of gaming experience do you prefer?

A whopping 61% came back with the answer "singleplayer".

Strategic savings! 75% off Total War titles - 24 hours only



Continuing our slew of SEGA deals this weekend, there's 75% off on the Total War titles this Saturday for 24 hours only, including a massive price reduction on Total War: Rome II - Emperor Edition.


Be sure to keep abreast of all of the hot deals we're running across the weekend by checking in regularly here, with discounts on plenty more SEGA titles like Alpha Protocol, Binary Domain, Castle of Illusion, The Cave, and Condemned: Criminal Origins.


Let us know in the comments if you pick any of them up!

Fuzzy_Pixels

GMG Staff Picks: Contrast, Another World, and Psychonauts



We're ringing the changes on our Staff Picks! Every week we'll deliver discounts on a fresh trio of titles lovingly handpicked by our very own staffers.

This week we have up to 75% off on three very different but equally brilliant games: Contrast, Another World: 20th Anniversary Edition, and Psychonauts.


These deals will run through until the afternoon of Friday 6th March, when we'll swap them out for another batch of bespoke bargains.

Fuzzy_Pixels

Valkyria Chronicles - Playfire Rewards Friday Special!


The critically acclaimed RPG Valkyria Chronicles graces Playfire Rewards once more, this time as a Special!  We've selected six of the trickier achievements to play for (for those who may have missed them) ...PLUS... we've extended the duration of these Rewards so people new to the game get a little more time to earn them!  Dovetailing nicely with the fact that you can pick it up over at GMG right now at half price!


With over three million Rewards delivered to-date, Playfire has provided a lot of people with cheaper games. If you haven't tried the Playfire Rewards Beta and want to participate, it's easy, just log into Playfire with your Green Man Gaming email address and password and link your Steam account to play your way to cheaper games! For more information check out our FAQ.

The GMG Weekender: 50% off SEGA titles



Alien: Isolation, Valkyria Chronicles, Warhammer 40K half price!

Sing it with us... SEEEEGAAAAAAAHHHHH!

This weekend we've got some big, fat SEGA deals coming your way, kicking off with 50% off on a bunch of excellent titles:


We suggest spending the money you save on spare underwear. You'll need all the help you can get in this atmospheric fright-fest. Experience what it means to be hunted down by crazy soldiers, warped androids, and one hungry, procedurally-generated Xenomorph. Clever girl.


One of the best SRPGs out there, Valkyria Chronicles boasts a refreshing World War setting, mature characters, and deep tactical combat. It still holds up as one of the finest JRPGs available to buy. Plus there are tanks... and who doesn't love tanks?


Take a load off this weekend, and soak yourself in a nice hot tub of nostalgia with the Blue Blur and his chums.


Blast pieces out of the zombie horde across 9 stages, one keystroke at a time, in order to save you and a friend's life as you work to uncover the mystery behind the outbreak.


Take on the mantle of Caesar in his Gallic campaign, purge the Black Seas of your enemies, and pit the might of Rome against the armies of Ancient Greece.


Become a Space Marine or usher in the dawn of a new war as an armchair general. Whether you're directing the battle or down in the thick of the action, it's time to save the galaxy.


We have Aliens, we have Predators, and we have Colonial Marines. Who's getting out alive?


Additionally, Iceberg Interactive are running 75% off on selected titles all throughout the next week, with the discounted roster changing daily.

Finally, on top of all of that, there are even more savings up for grabs with our new 20% off voucher*:

B1CYB0-CLSSD1-ARAAGM

What are you going to use it on? Click here to head over to the GMG store right now!

Fuzzy_Pixels

*Valid until 3rd March 16:00 UTC. Voucher excludes selected titles and cannot be used in conjunction with GMG Credit.

Over 9000 Zombies gets full release, 25% off right now!



Sometimes, if we've had a long day, or are maybe just feeling a little meh, we find it incredibly helpful, soothing, and cathartic to kill a whole bunch of pixellated zombies.

And when it comes to pixellated zombie killing, Over 9000 Zombies has you covered.

This week, Loren Lemke's action-packed slice of top-down, pick-up-and-play zombie busting emerged from Early Access into the full version.


Europa Universalis IV: El Dorado out now!




Calling all grand strategy fans and armchair generals, it's time to conquer the world.

El Dorado is the fifth expansion to the hugely popular Europa Universalis IV, and lets players immerse themselves in the conquests, creeds and discoveries of the Age of Exploration.

And it's out right now!

Pick up Europa Universalis IV: El Dorado over on the GMG store here >>

This expansion is rife with new religions, Sun Worship, and blood sacrifices as Aztecs and Europeans vie for control of the Central and South Americas. There's wealth to be had in this New World if the land can be conquered and controlled. Do you have what it takes to subject the Mexican plains to your rule?

The fast and furious: 80% off Velocibox




Up for some high-speed hi-jinks? Fancy getting stuck into a game that will test the very limits of your reflexes?

Have a gander at Velocibox.

Oscura: Lost Light - Playfire Rewards Thursday


Reminiscent of the atmospheric Limbo (which is no bad thing at all!) Chocolate Liberation Front's 2D puzzle-platformer finds you in search of the 'lost shards of the Aurora Stone to restore light to the Driftlands' - sounds like the beginnings of a beautiful adventure!  Pick it up over at GMG and play for a six-pack of Rewards!  The Driftlands need you!


With over three million Rewards delivered to-date, Playfire has provided a lot of people with cheaper games. If you haven't tried the Playfire Rewards Beta and want to participate, it's easy, just log into Playfire with your Green Man Gaming email address and password and link your Steam account to play your way to cheaper games! For more information check out our FAQ.

Inventive vehicle-building puzzler Keebles launches on March 27th!




Oh we've got some seriously big news today, folks!

Green Man Loaded is proud to announce that the addictive physics-based vehicle building puzzler Keebles by Burnt Fuse Games will launch via Green Man Gaming on 27th March 2015!