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
reservaExistente = new ReservaBuilder() | |
.ComProduto(produtoReservado, 1) | |
.ParaCliente(null) | |
.ComOrigem(OrigemVenda.Parceiro) | |
.VigentePor(3) | |
.Build(); |
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
SIF Utiltiy | |
SIF Upload | |
SIF parsing | |
Authentication | |
Authentication User | |
Authentication User for posting | |
Authentication Customer # for the user setup | |
Authentication Customer # from the file | |
XML Processing | |
XML translation/Parsing |
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
using NUnit.Framework; | |
namespace NUnitDataDriven | |
{ | |
[TestFixture] | |
public class DataTests | |
{ | |
[Test, TestCaseSource("GetDataForTesting")] | |
public void age_should_be_over_18(Data data) | |
{ |
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
#light | |
namespace NParser | |
module StateMonad = | |
type State<'s,'a> = State of ('s -> ('a *'s)) | |
let runState (State f) = f | |
type StateBuilder() = | |
member b.Return(x) = State (fun s -> (x,s)) | |
member b.Delay(f) = f() : State<'s,'a> |
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
#light | |
namespace NParser | |
module Lexer = | |
open System | |
open System.Collections.Generic | |
open System.Text.RegularExpressions | |
open StateMonad | |
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
#light | |
namespace NParser | |
open System | |
open Lexer | |
type NomosParser() = | |
static member Parse(stringToParse:string) = | |
let definitions = state { | |
do! addDefinition "String" "[a-zA-Z]+" |
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 entryDate = match List.filter dateToken tokens with | |
| r when r.Length > 0 -> | |
Some(Seq.head r) | |
| otherwise -> | |
None |
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
//C# | |
public T FindInList(List<T> source, List<T> target> | |
{ | |
foreach(T item in source) | |
{ | |
foreach(T targ in target) | |
{ | |
if(item == targ) | |
return item |
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 ProductDetailTranslator | |
{ | |
public ProductDetail Translate(string xmlFrom) | |
{ | |
var productTo = new ProductDetail(); | |
var xmlReader = XmlReader.Create(new StringReader(xmlFrom)); | |
var productDetail = XElement.Load(xmlReader); | |
var parentGroups = productDetail.Elements("Grouping").First().Elements("section") | |
.Select(parentGroup => new Group() { Name = parentGroup.Elements("displayname").First().Value, Items = GetChildren(parentGroup).ToList() }); |
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 Node = function (v) { | |
if ( !(this instanceof arguments.callee) ) { | |
throw new Error("Constructor called as a function"); | |
} | |
this.value = v; | |
this.next = null; | |
this.previous = null; | |
} |