Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Runtime.InteropServices;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Geometry;
using Blog.SoeExample.Model;
namespace Blog.SoeExample.Repository
{
using System.Collections.Generic;
using ESRI.ArcGIS.Geodatabase;
using Blog.SoeExample.Model;
namespace Blog.SoeExample.Repository
{
public interface IExampleRepository
{
// workspace dependency
using System;
using System.Text;
using System.Collections.Generic;
using System.Collections.Specialized;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.SOESupport;
using Blog.SoeExample.Repository;
namespace Blog.SoeExample.Service
{
using System.Collections.Specialized;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.SOESupport;
namespace Blog.SoeExample.Service
{
public interface IExampleService
{
// workspace dependency
IWorkspace Workspace { get; set; }
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Specialized;
using System.Runtime.InteropServices;
using Castle.Windsor;
using Castle.Windsor.Installer;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Server;
// tests with mocked dependencies
[TestClass]
public class CheckoutTests
{
private Mock<IPriceList> drinksMenu;
private Mock<IClock> clock;
private List<Order> orders;
[TestInitialize]
// code that's testable
public class Checkout
{
private IPriceList drinksMenu;
private IClock clock;
public Checkout(IPriceList drinksMenu, IClock clock)
{
this.drinksMenu = drinksMenu;
// code that's extremely difficult to test
public class Checkout
{
public decimal CalculateCost(List<Order> orders)
{
// get the price list
var drinksMenu = getDrinksMenu();
var total = 0.0m;
// code that's difficult to test
public class Checkout
{
public decimal CalculateCost(List<Order> orders)
{
// get the price list
var drinksMenu = getDrinksMenu();
var total = 0.0m;
@stoolrossa
stoolrossa / S3TiledMapServiceLayerConfigurableDefinition.js
Created December 13, 2012 13:41
Example of S3TileMapServiceLayer class using the ArcGIS Javascript API, with a configurable definition for the map service details.
dojo.require("esri.map");
dojo.require("esri.layers.tiled");
dojo.require("dojo/string");
var map;
function init() {
dojo.declare("S3TiledMapServiceLayer", esri.layers.TiledMapServiceLayer, {