This file contains 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
module Fake.NDepend | |
open Fake | |
open System | |
open System.IO | |
open System.Text | |
let getWorkingDir workingDir = | |
Seq.find isNotNullOrEmpty [workingDir; environVar("teamcity.build.workingDir"); "."] | |
|> Path.GetFullPath |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>D3.xml Example</title> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.v2.js"></script> | |
<style type="text/css"> | |
.chart div { | |
font: 10px sans-serif; | |
background-color: steelblue; | |
text-align: right; |
This file contains 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 class Router : NancyModule, IRouter | |
{ | |
public Router() | |
: base("/") | |
{ | |
Get["test"] = x => "hello"; | |
} | |
public void HttpGet(string path, Func<dynamic, dynamic> action) | |
{ | |
Get[path] = x => action; |
This file contains 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
let setters = Types.WithFullName("NDepend.Attributes.CodeRuleAttribute").ChildMethods() | |
.Where(m => m.IsPropertySetter) | |
from m in Methods.UsingAny(setters) | |
select new { m, settersCalled = m.MethodsCalled.Intersect(setters) } |
This file contains 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
[Test, RequiresSTA] | |
public void DeleteBrickCommand_BrickSelected_ExpectEnableMainWindowMessageSentWithFalseThenTrue() | |
{ | |
//Arrange | |
var productViewModel = makeProductViewModel(); | |
var brick = productViewModel.AddBrick(); | |
var rootGraphSourceViewModel = new RootGraphSourceViewModel(); | |
rootGraphSourceViewModel.Initialize(productViewModel); | |
rootGraphSourceViewModel.Show(); |
This file contains 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
[Test] | |
public void Execute_ImportSuccessFulWithoutModifiedText_ExpectNoModelChangedMessageSent() | |
{ | |
//Arrange | |
var importCommand = makeImportAllTextsCommand(new ImportStatistics {ImportedCount = 0}); | |
var messageSent = false; | |
Messenger.Default.Register<ModelChangedMessage>(this, message => messageSent = true); | |
//Act |
This file contains 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
[Test] | |
public void ValueRangeType_SetToAValueWithOneValueRangeValueSelected_ExpectPropertyChangedFiredValueSetAndModelChangedMessageSent() | |
{ | |
//Arrange | |
var viewModel = makeValueRangeViewModel(); | |
var valueViewModel = viewModel.AddValue("value"); | |
valueViewModel.IsSelected = true; | |
//Act | |
//Assert |
This file contains 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
[Test] | |
public void BusinessUnit_SetToAValue_ExpectedPropertyChangedFired() | |
{ | |
//Arrange | |
//Act | |
//Assert | |
_viewModel.Should() | |
.FirePropertyChangedOn(s => s.BusinessUnit) | |
.When(s => s.BusinessUnit = "Test2"); |
This file contains 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
var mouseDowns = Observable.FromEventPattern<MouseButtonEventHandler, MouseButtonEventArgs>(h => MouseDown += h, h => MouseDown -= h); | |
var mouseUps = Observable.FromEventPattern<MouseButtonEventHandler, MouseButtonEventArgs>(h => MouseUp += h, h => MouseUp -= h); | |
mouseDowns.Merge(mouseUps).WhenAny() .Subscribe(OneMouseUp); | |
} | |
private void OneMouseUp(EventPattern<MouseButtonEventArgs> eventPattern) | |
{ | |
var windowUnderCursor = NativeMethods.GetWindowUnderMouse(); |
This file contains 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
module.exports = (robot) -> | |
robot.router.post "/hubot/appharbor", (req, res) -> | |
robot.logger.info "Message received for appharbor" | |
builtApplicationName = req.body.application.name | |
buildStatus = req.body.build.status | |
robot.logger.info "AppHarbor build '#{buildStatus}' for application: '#{builtApplicationName}'" | |
user = robot.userForId 'broadcast' |