public void Instanciar() { var factory = new GtFactory(); IPais pais = factory.Instantiate <IPais>(); ITituloEleitor titulo = factory.Instantiate <ITituloEleitor>(); this.GarantirTipoDoObjeto <Pais>(pais); this.GarantirTipoDoObjeto <TituloEleitor>(titulo); }
public void LimparTodosMapeamentos() { var factory = new GtFactory(); factory.AddMapping <IPais, PaisStub>(); factory.AddMapping <ICidade, CidadeStub>(); factory.ClearAllMappings(); IPais pais = factory.Instantiate <IPais>(); ICidade cidade = factory.Instantiate <ICidade>(); this.GarantirTipoDoObjeto <Pais>(pais); this.GarantirTipoDoObjeto <Cidade>(cidade); }
public void LimparMapeamento() { var factory = new GtFactory(); factory.AddMapping <IPais, PaisStub>(); factory.AddMapping <ICidade, CidadeStub>(); // O Método LimparMapeamento remove o mapeamento do tipo especificado. factory.CleanMappings <IPais>(); IPais pais = factory.Instantiate <IPais>(); ICidade cidade = factory.Instantiate <ICidade>(); this.GarantirTipoDoObjeto <Pais>(pais); this.GarantirTipoDoObjeto <CidadeStub>(cidade); }
public void StartHitedIsNotReset() { var factory = new GtFactory(); factory.AddMapping <IGtPlayedNotesAnalyserHelper, MockGtPlayedNotesAnalyserHelperAlwaysIsNotPlaying>(); var analyser = factory.Instantiate <IGtPlayedNotesAnalyser>(factory, new DoubleAudioListenerDoNothing(40)); var note = new GtSceneGuitarNote(new BeatTick(1, 0), new BeatTick(1, 240), 6, 0); var startingNotes = new List <GtSceneGuitarNote>(); startingNotes.Add(note); var expectedPlayingNotes = new List <GtSceneGuitarNote>(); expectedPlayingNotes.Add(note); note.Playing = true; note.StartHited = true; analyser.Analyse(startingNotes, expectedPlayingNotes); Assert.IsTrue(startingNotes[0].StartHited); Assert.IsFalse(startingNotes[0].Playing); }
public void ConstructUsingTheFactory() { var factory = new GtFactory(); var p = factory.Instantiate <IGtPlayedNotesAnalyser>(factory, new DoubleAudioListenerDoNothing(40)); Assert.IsNotNull(p); }
public void AdicionarMapeamento() { var factory = new GtFactory(); factory.AddMapping <IPais, PaisStub>(); IPais pais = factory.Instantiate <IPais>(); this.GarantirTipoDoObjeto <PaisStub>(pais); }
private void Initialize(GtFactory pFactory, GtGameController pGameController) { InitializeProperties(); this.Factory = pFactory; this.GameController = pGameController; this.PlayedNotesAnalyser = Factory.Instantiate <IGtPlayedNotesAnalyser>(this.Factory, pGameController.AudioListener); }
private void Initialize(GtFactory pFactory, GtFileLoader pFileLoader, ISongPlayer pSongPlayer, IAudioEffects pAudioEffects) { this.Factory = pFactory; this.SongPlayer = pSongPlayer; this.fFileLoader = pFileLoader; this.AudioEffects = pAudioEffects; this.CurrentScreen = EnumGameScreen.Undefined; this.AudioListener = pFactory.Instantiate <IAudioListener>(SAMPLE_FREQUENCE); //must be after AudioListener instantiation this.GameRoundController = pFactory.Instantiate <IGtGameRoundController>(pFactory, this); this.TuneController = pFactory.Instantiate <IGtTuneController>(); this.AudioListener.Start(); }
public void OnePlayingNoteShouldReturn1Point() { var factory = new GtFactory(); factory.AddMapping <IGtPlayedNotesAnalyserHelper, MockGtPlayedNotesAnalyserHelperAlwaysIsPlaying>(); var analyser = factory.Instantiate <IGtPlayedNotesAnalyser>(factory, new DoubleAudioListenerDoNothing(40)); var note1 = new GtSceneGuitarNote(new BeatTick(1, 0), new BeatTick(1, 240), 6, 0); var startingNotes = new List <GtSceneGuitarNote>(); var expectedPlayingNotes = new List <GtSceneGuitarNote>(); expectedPlayingNotes.Add(note1); var points = analyser.Analyse(startingNotes, expectedPlayingNotes); Assert.AreEqual(1, points); }
public void AnalyseMustReturnZeroIfNoNoteIsCorrect() { var factory = new GtFactory(); factory.AddMapping <IGtPlayedNotesAnalyserHelper, MockGtPlayedNotesAnalyserHelperAlwaysIsNotPlaying>(); var analyser = factory.Instantiate <IGtPlayedNotesAnalyser>(factory, new DoubleAudioListenerDoNothing(40)); var note = new GtSceneGuitarNote(new BeatTick(1, 0), new BeatTick(1, 240), 6, 0); var startingNotes = new List <GtSceneGuitarNote>(); startingNotes.Add(note); var expectedPlayingNotes = new List <GtSceneGuitarNote>(); expectedPlayingNotes.Add(note); var points = analyser.Analyse(startingNotes, expectedPlayingNotes); var maxPoints = analyser.AnalyseMaximum(startingNotes, expectedPlayingNotes); Assert.AreEqual(0, points); Assert.AreEqual(101, maxPoints); }
public void Instanciar_ClassePadraoNaoExiste() { var factory = new GtFactory(); factory.Instantiate <IContrato>(); }
public void Instanciar_Classe() { var factory = new GtFactory(); factory.Instantiate <Pais>(); }