public void BuildBoatTypesTest() { //arrange int boatType = 1; //act BoatFactory BoatFactory = new BoatFactory(); Boat actual = BoatFactory.BuildBoat(boatType); //assert Assert.IsInstanceOfType(actual, typeof(NarrowBoat)); }
void ProcessSequenceItems(DBRecord[] results, bool justRead) { _sequenceRecords = results .ToDictionary( x => new Tuple <string, string, int>(x.Fields["Name"].ToString(), x.Fields["Token"].ToString(), ((NSNumber)x.Fields["StartNumber"]).IntValue), x => x); var writtenLocations = new List <Tuple <string, string> >(); foreach (var kvp in _sequenceRecords) { ISequenceItem item; _sequenceDictionary.TryGetValue(kvp.Key, out item); // this check means we are only going to be writing for a change we've not seen if (item == null) { IBoat boat; if (kvp.Key.Item3 <= 0) { boat = new BoatFactory().SetNumber(kvp.Key.Item3).Create(); } else { boat = _boatDictionary[kvp.Key.Item3]; } item = kvp.Value.ToItem(boat); _sequenceDictionary.Add(kvp.Key, item); writtenLocations.Add(new Tuple <string, string>(kvp.Key.Item1, kvp.Key.Item2)); } // todo - the super user will want to have all changes written } if (!justRead) { WriteDropboxFile(writtenLocations.Distinct(), _sequenceDictionary); } _raceStore.BeginInvokeOnMainThread(() => { if (ItemsListUpdated != null) { ItemsListUpdated(this, EventArgs.Empty); } }); }
void ProcessSequenceItems(DBRecord[] results, bool justRead) { _sequenceRecords = results .ToDictionary( x => new Tuple<string,string,int>(x.Fields["Name"].ToString(), x.Fields["Token"].ToString(), ((NSNumber)x.Fields["StartNumber"]).IntValue), x => x); var writtenLocations = new List<Tuple<string,string>>(); foreach(var kvp in _sequenceRecords) { ISequenceItem item; _sequenceDictionary.TryGetValue(kvp.Key, out item); // this check means we are only going to be writing for a change we've not seen if(item == null) { IBoat boat; if(kvp.Key.Item3 <= 0) boat = new BoatFactory().SetNumber(kvp.Key.Item3).Create(); else boat = _boatDictionary[kvp.Key.Item3]; item = kvp.Value.ToItem(boat); _sequenceDictionary.Add(kvp.Key, item); writtenLocations.Add(new Tuple<string, string>(kvp.Key.Item1, kvp.Key.Item2)); } // todo - the super user will want to have all changes written } if(!justRead) WriteDropboxFile(writtenLocations.Distinct(), _sequenceDictionary); _raceStore.BeginInvokeOnMainThread (() => { if (ItemsListUpdated != null) ItemsListUpdated (this, EventArgs.Empty); }); }
public MarinaMaintenanceObj() { this.Marina = new Marina(); this.BoatFactory = new Factory.BoatFactory(); }