Beispiel #1
0
 public void SetUp()
 {
     writer       = new StringWriter();
     error_writer = new StringWriter();
     mtc          = new PrimitiveMmlProcessor(writer, error_writer);
     tc           = new TrackController(new PrimitiveMmlProcessingContext(mtc));
 }
        protected void ddlArtista_SelectedIndexChanged(object sender, EventArgs e)
        {
            string artist = ddlArtista.SelectedValue;

            gvInformacion.DataSource = TrackController.BuscarArtista(artist);
            gvInformacion.DataBind();
        }
        public void CloseTrackTest()
        {
            TrackController target  = new TrackController(); // TODO: Initialize to an appropriate value
            string          trackId = string.Empty;          // TODO: Initialize to an appropriate value
            bool            actual;

            actual = target.CloseTrack(trackId);
            Assert.IsFalse(actual);

            // can't close a track that isn't owned
            trackId = "akljkjcbao";
            actual  = target.CloseTrack(trackId);
            Assert.IsFalse(actual);

            // assert true if controller owns track and is able to close it
            TrackBlock block = new TrackBlock();

            block.Name = trackId = "TestName";
            target.AddTrackBlock(block);
            actual = target.CloseTrack(trackId);
            Assert.IsTrue(actual);

            // assert false if track is already closed
            actual = target.CloseTrack(trackId);
            Assert.IsFalse(actual);

            // shouldn't be able to close a track with a train on it
            block.Status.IsOpen       = true;
            block.Status.TrainPresent = true;
            actual = target.CloseTrack(trackId);
            Assert.IsFalse(actual);
        }
Beispiel #4
0
 private void Awake()
 {
     tracker    = TrackController.Instance;
     animator   = GetComponentInChildren <Animator> ();
     _collider  = GetComponent <BoxCollider> ();
     _transform = transform;
 }
        public void CloseTrackTest()
        {
            TrackController target = new TrackController(); // TODO: Initialize to an appropriate value
            string trackId = string.Empty; // TODO: Initialize to an appropriate value
            bool actual;
            actual = target.CloseTrack(trackId);
            Assert.IsFalse(actual);

            // can't close a track that isn't owned
            trackId = "akljkjcbao";
            actual = target.CloseTrack(trackId);
            Assert.IsFalse(actual);

            // assert true if controller owns track and is able to close it
            TrackBlock block = new TrackBlock();
            block.Name = trackId = "TestName";
            target.AddTrackBlock(block);
            actual = target.CloseTrack(trackId);
            Assert.IsTrue(actual);

            // assert false if track is already closed
            actual = target.CloseTrack(trackId);
            Assert.IsFalse(actual);

            // shouldn't be able to close a track with a train on it
            block.Status.IsOpen = true;
            block.Status.TrainPresent = true;
            actual = target.CloseTrack(trackId);
            Assert.IsFalse(actual);
        }
    private SceneSoundLibrary soundLibrary;  // Script wich contains all the used sounds for the scene.

    // Use this for initialization
    void Start()
    {
        trackController = GameObject.FindObjectOfType <TrackController>().GetComponent <TrackController>();
        soundLibrary    = GameObject.FindObjectOfType <SceneSoundLibrary>().GetComponent <SceneSoundLibrary>();

        if (trackController == null)
        {
            Debug.LogError("TrackController never got instanciated (Scene persistent object)");
        }
        if (soundLibrary == null)
        {
            Debug.LogError("SceneSoundLibrary not found in the scene");
        }
        if (MuteIconArray.Length != 3)
        {
            Debug.LogError("'MuteIconArray' not set correctly in 'VolSlidersController': 0 is background, 1 is FX, 2 is UI");
        }
        if (soundIcon == null || mutedIcon == null)
        {
            Debug.LogError("Mute/Unmute icons not set in 'VolSlidersController' in the settings object of the UI");
        }

        // Multiplies on 100 to set the correct slider values (o - 100 instead of 0 - 1)
        master.value     = trackController.masterVolume * 100;
        background.value = trackController.backgroundVolume * 100;
        fx.value         = trackController.fxVolume * 100;
        ui.value         = trackController.uiVolume * 100;
    }
Beispiel #7
0
 private void Awake ()
 {
     tracker = TrackController.Instance;
     animator = GetComponentInChildren<Animator> ();
     _collider = GetComponent<BoxCollider> ();
     _transform = transform;
 }
        public void UpdateTest()
        {
            TrackController target = new TrackController();             // TODO: Initialize to an appropriate value

            target.Update();
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
Beispiel #9
0
        public void CreateTrack_UnderNormalConditions_ReturnsOkResponse()
        {
            //arrange
            var trackToCreate = new TrackDto()
            {
                TrackId          = 7,
                IsActive         = true,
                TrackDescription = "test description 7",
                TrackName        = "track name 7"
            };

            Mock.Arrange(() => _trackService.Create(trackToCreate))
            .Returns(trackToCreate)
            .OccursOnce();

            var trackController = new TrackController(_trackService)
            {
                Request = new HttpRequestMessage()
                {
                    RequestUri = new Uri("http://localhost/api/track")
                }
            };

            //act
            var actual        = trackController.Post(trackToCreate) as CreatedNegotiatedContentResult <TrackDto>;
            var actualContent = actual.Content;

            //assert
            Mock.Assert(_trackService);
            Assert.That(actual, Is.Not.Null);
            Assert.That(actual, Is.TypeOf <CreatedNegotiatedContentResult <TrackDto> >());
            Assert.That(actualContent, Is.EqualTo(trackToCreate));
        }
Beispiel #10
0
        public void UpdateTrack_WhereTrackExists_ReturnsOkResponse([Values(1, 2, 3)] int idOfTrackToBeUpdated)
        {
            //arrange
            var trackToUpdate = _trackList.FirstOrDefault(tr => tr.TrackId == idOfTrackToBeUpdated);

            Mock.Arrange(() => _trackService.Update(trackToUpdate))
            .Returns(trackToUpdate)
            .OccursOnce();

            var trackController = new TrackController(_trackService)
            {
                Request = new HttpRequestMessage()
                {
                    RequestUri = new Uri("http://localhost/api/track")
                }
            };

            //act
            var actual        = trackController.Put(trackToUpdate) as OkNegotiatedContentResult <TrackDto>;
            var actualContent = actual.Content;

            //assert
            Mock.Assert(_trackService);
            Assert.That(actual, Is.Not.Null);
            Assert.That(actual, Is.TypeOf <OkNegotiatedContentResult <TrackDto> >());
            Assert.That(actualContent, Is.EqualTo(trackToUpdate));
        }
Beispiel #11
0
 // Use this for initialization
 void Start()
 {
     cubeSound = GetComponent <AudioSource>();
     track     = GameObject.FindGameObjectWithTag("Track");
     script    = track.GetComponent <TrackController>();
     movement  = new Vector3(0f, 0f, -2.5f);
 }
        private void CargarGrilla()
        {
            string artist = ddlArtista.SelectedValue;

            gvInformacion.DataSource = TrackController.BuscarArtista(artist);
            gvInformacion.DataBind();
        }
Beispiel #13
0
    // Use this for avoid get destroyed on scene load & not getting declarated twice
    void Awake()
    {
        if (instance)
        {
            DestroyImmediate(this.gameObject);
        }
        else
        {
            DontDestroyOnLoad(this.gameObject);
            instance = this;

            // Requires 3 tracks to function correctly
            // Creates and sets the tracks.
            uiTrack         = this.gameObject.AddComponent <AudioSource>();
            fxTrack         = this.gameObject.AddComponent <AudioSource>();
            backgroundTrack = this.gameObject.AddComponent <AudioSource>();

            // Adds the tracks into an array for numeric calls. Tracks are stored in the array in the create inverse order.
            audioTracks = FindObjectsOfType <AudioSource>();

            // Sets the AudioSource components correctly
            foreach (AudioSource track in audioTracks)
            {
                track.playOnAwake = false;
            }
            audioTracks[0].loop = true; // Prepares the background track to loop at the end of the clip

            // Loads audio volumes from previous seasons (if were any)
            LoadAudioValues();
        }
    }
Beispiel #14
0
        public void ContactInDbDoesNotCreateDuplicate()
        {
            var contactRepository = new LocalRepository <Contact>();
            var serverTime        = new Mock <IServerTime>();
            var contactAutoRating = new Mock <IContactAutoRating>();

            var controller = new TrackController(
                contactRepository,
                serverTime.Object,
                contactAutoRating.Object);
            var now = new DateTime(2014, 01, 01);

            serverTime.Setup(st => st.Now).Returns(now);
            var request = new Mock <HttpRequestBase>();

            var contact = new Contact
            {
                LeadType = "Email",
                ClientId = 1,
                Date     = now,
            };

            contact.Property.Add(new ContactProperty
            {
                Type  = "FormData",
                Value = "{\"firstName\":\"javad\",\"Telefon\":\"0123456\",\"e-post\":\"[email protected]\",\"description\":\"information\"}"
            });

            contact.Property.Add(new ContactProperty
            {
                Type  = "FormPostId",
                Value = "1-123456-0987"
            });
            contactRepository.Add(contact);

            var requestParams = new NameValueCollection
            {
                { "id", "1-123456-0987" },
                { "data", "{\"firstName\":\"javad\",\"Telefon\":\"0123456\",\"e-post\":\"[email protected]\",\"description\":\"information\"}" }
            };

            request.Setup(r => r.Params).Returns(requestParams);

            var server = new Mock <HttpServerUtilityBase>();

            server.Setup(su => su.MapPath("/Content/collect.gif")).Returns("~/Content/collect.gif");
            var context = new Mock <HttpContextBase>();

            context.SetupGet(x => x.Request).Returns(request.Object);
            context.SetupGet(x => x.Server).Returns(server.Object);

            controller.ControllerContext = new ControllerContext(context.Object, new RouteData(), controller);


            var result = controller.Index();


            Assert.AreEqual(1, contactRepository.All().Count());
        }
Beispiel #15
0
 private void Start()
 {
     _track        = FindObjectOfType <TrackController>();
     _cart         = FindObjectOfType <CartMovement>();
     audio         = GetComponent <AudioSource>();
     startingPos   = transform.parent.transform.position;
     CurrentHealth = MaxHealth;
 }
Beispiel #16
0
        public void SetUp()
        {
            _fakeConverter = Substitute.For <ITransponderDataConverter>();
            _fakeReceiver  = Substitute.For <ITransponderReceiver>();
            _fakeMapDrawer = Substitute.For <IMapDrawer>();

            _uut = new TrackController(_fakeReceiver, _fakeConverter, _fakeMapDrawer);
        }
Beispiel #17
0
        public void Details_GetView_CheckRightView()
        {
            _controller = new TrackController(_mockUser.Object, _trackService, _mockPlace.Object);

            var result = _controller.Details(_trackService.GetItemList().FirstOrDefault().Id.Value) as PartialViewResult;

            Assert.AreEqual("firstTrack", ((TrackViewModels)result.ViewData.Model).Name);
        }
    private void Start()
    {
        InvokeRepeating("ModifySpeed", 0f, 10f);        //for testing
        InvokeRepeating("CalculateControls", 0f, 1 / Constants.targetHz);

        trackController = new TrackController();
        sys             = new AsymmetricFirstOrderSystem(Constants.trackSimK, Constants.trackSimIncreaseTau, Constants.trackSimDecreaseTau, Constants.targetHz, 0f);
    }
Beispiel #19
0
    // Start is called before the first frame update
    void Awake()
    {
        trackCtrl = GetComponent <TrackController>();
        uiCtrl    = GetComponent <UI_Controller>();
        logCtrl   = GetComponent <Log_Controller>();

        logCtrl.StartLogging();
    }
 void Awake()
 {
     // This is in Awake. In start is was not selected quick enough
     // for trackController's calls to SetColor().
     sr = GetComponent <SpriteRenderer>();
     trackController = GameObject.FindGameObjectWithTag("Track")
                       .GetComponent <TrackController>();
 }
Beispiel #21
0
 private void Start()
 {
     track_controller = GameObject.Find("TrackController").GetComponent <TrackController>();
     if (track_controller == null)
     {
         Debug.Log("Got no track controller!");
     }
 }
 private List<ShippingProvider> LoadProvider()
 {
     TrackController ctl = new TrackController();
     AspxCommonInfo commonInfo = new AspxCommonInfo();
     commonInfo.StoreID = GetStoreID;
     commonInfo.PortalID = GetPortalID;
     var data = ctl.GetProviderList(commonInfo);
     return data;
 }
Beispiel #23
0
 /// <summary>
 /// 创建欧洲专线平邮事件码大于10的自定义跟踪信息
 /// </summary>
 public static void CreateCustomTrackInfo(List <ShippingMethodModel> shippingMethodIds, Dictionary <int, List <ShippingMethodConfig> > dictionary)
 {
     try
     {
         Log.Info("开始插入欧洲专线平邮事件码大于10的自定义跟踪信息");
         var list = TotalPackageTraceInfoController.GetB2CForeCastLogs();
         if (list.Any())
         {
             int shippingMethodId = shippingMethodIds.SingleOrDefault(p => p.Code == _DDPShippingMethodCode)
                                    .ShippingMethodId;
             var config =
                 dictionary[_EUDDPMaxEventCode].Where(p => p.ShippingMethodId == shippingMethodId).ToList();
             var addconfig = dictionary[_EUDDPMaxEventCode + 1].Where(p => p.ShippingMethodId == shippingMethodId).ToList();
             var result    = TrackController.GetB2CForeCastLogsSchema();
             var i         = 1;
             foreach (var model in list)
             {
                 DataRow row = result.NewRow();
                 row["WayBillNumber"] = model.WayBillNumber;
                 row["EventCode"]     = _EUDDPMaxEventCode;
                 row["IsOkJob"]       = 0;
                 row["CreatedOn"]     = DateTime.Now;
                 row["LastUpdatedOn"] = DateTime.Now;
                 var c = config.SingleOrDefault(p => p.CountryCode.ToUpper() == model.EventContent.ToUpper()) ??
                         config.Single(p => p.CountryCode == "Other");
                 row["EventDate"] =
                     model.EventDate.AddHours(c.AddHours)
                     .AddMilliseconds(new Random(i).Next(-2 * 60 * 60 * 1000, 2 * 60 * 60 * 1000));
                 row["EventContent"]  = c.EventContent;
                 row["EventLocation"] = c.CountryCode == "Other" ? model.EventLocation : c.Address;
                 result.Rows.Add(row);
                 i++;
                 DataRow addrow = result.NewRow();
                 addrow["WayBillNumber"] = model.WayBillNumber;
                 addrow["EventCode"]     = _EUDDPMaxEventCode + 1;
                 addrow["IsOkJob"]       = 0;
                 addrow["CreatedOn"]     = DateTime.Now;
                 addrow["LastUpdatedOn"] = DateTime.Now;
                 var c1 = addconfig.SingleOrDefault(p => p.CountryCode.ToUpper() == model.EventContent.ToUpper()) ??
                          addconfig.Single(p => p.CountryCode == "Other");
                 addrow["EventDate"] = model.EventDate.AddHours(c.AddHours + c1.AddHours)
                                       .AddMilliseconds(new Random(i).Next(-2 * 60 * 60 * 1000, 2 * 60 * 60 * 1000));
                 addrow["EventContent"]  = c1.EventContent;
                 addrow["EventLocation"] = c1.CountryCode == "Other" ? model.EventLocation : c1.Address;
                 result.Rows.Add(addrow);
                 i++;
             }
             TrackController.BulkToDb(result, "B2CForeCastLogs");
             TotalPackageTraceInfoController.UpdateCustomeIsOkJob();
             Log.Info("完成插入欧洲专线平邮事件码大于10的自定义跟踪信息");
         }
     }
     catch (Exception ee)
     {
         Log.Exception(ee);
     }
 }
Beispiel #24
0
        public static void Main(string [] args)
        {
            var p   = new RawMidiProcessor();
            var ctx = new SimpleControllerProcessingContext(p);
            var tp  = new TrackController(ctx);

            tp.Channel = 0;
            tp.Note(0x40);
        }
        public void GetAllTracks()
        {
            var mockTracks = new Mock <ITrackLogic>(MockBehavior.Strict);

            mockTracks.Setup(u => u.GetAll()).Returns(trackList);
            var trackController = new TrackController(mockTracks.Object);

            Assert.AreEqual(new OkObjectResult("").ToString(), trackController.GetAll().ToString());
        }
Beispiel #26
0
        public void Edit_GetView_CheckRightView()
        {
            _controller = new TrackController(_mockUser.Object, _trackService, _mockPlace.Object);

            var result     = _controller.Edit(_trackService.GetItemList().FirstOrDefault().Id.Value) as ViewResult;
            var resultData = (TrackViewModels)result.ViewData.Model;

            Assert.AreEqual(track1.Name, resultData.Name);
        }
Beispiel #27
0
    void Start()
    {
        _instance     = this;
        _currentTrack = Tracks[0];
        _lastTrack    = Tracks[9];

        //Debug.Log(_currentTrack);
        //Debug.Log(_lastTrack);
        //Debug.Log(_currentTrackValue);
    }
        public static void Initialize(TestContext context)
        {
            _trackController = new TrackController();

            Mapper.Reset();
            Mapper.Initialize(config =>
            {
                config.AddProfile <MappingProfile>();
            });
        }
Beispiel #29
0
    private void Start()
    {
        trackController = GameObject.FindGameObjectWithTag("Track")
                          .GetComponent <TrackController>();

        goldMedal.SetActive(false);
        silverMedal.SetActive(false);
        bronzeMedal.SetActive(false);
        results.SetActive(false);
    }
        public void GetAllTrackStatusTest()
        {
            TrackController target = new TrackController();             // TODO: Initialize to an appropriate value
            Dictionary <string, TrackStatus> expected = null;           // TODO: Initialize to an appropriate value
            Dictionary <string, TrackStatus> actual;

            actual = target.GetAllTrackStatus();
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
Beispiel #31
0
    private void Awake()
    {
        trackCtrl = GameObject.Find("TrackController").GetComponent <TrackController>();

        pausedMenu = GameObject.Find("PausedMenu");
        pausedMenu.SetActive(false);

        restartMenu = GameObject.Find("RestartMenu");
        restartMenu.SetActive(false);
    }
        public void SetSwitchTest()
        {
            TrackController target   = new TrackController(); // TODO: Initialize to an appropriate value
            TrackSwitch     s        = null;                  // TODO: Initialize to an appropriate value
            bool            expected = false;                 // TODO: Initialize to an appropriate value
            bool            actual;

            actual = target.SetSwitch(s);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
Beispiel #33
0
        public void Delete_ClickDelete_CheckWork()
        {
            _controller = new TrackController(_mockUser.Object, _trackService, _mockPlace.Object);
            var lastTrackBeforeDel = _trackService.GetItemList().LastOrDefault();

            var result = _controller.Delete(lastTrackBeforeDel.Id.Value) as RedirectToRouteResult;

            Assert.AreEqual("Index", result.RouteValues["action"]);
            _trackService.Create(track2);
            _trackService.Save();
        }
        public void AddTrackBlockTest()
        {
            TrackController target = new TrackController(); // TODO: Initialize to an appropriate value
            TrackBlock block = null; // TODO: Initialize to an appropriate value
            bool actual;
            actual = target.AddTrackBlock(block);
            Assert.IsFalse(actual);

            block = new TrackBlock();
            actual = target.AddTrackBlock(block);
            Assert.IsTrue(actual);
        }
Beispiel #35
0
 void Start()
 {
     currentTrackPiece = GameObject.FindGameObjectWithTag("TrackPiece");
     disappearScript = currentTrackPiece.GetComponent<DisappearAfterTime>();
     disappearScript.enabled = false;
     playerInputReceived = false;
     totalDistanceTraveled = 0;
     startingPosition = player.transform.position.z;
     checkpointIncrement = 50f;
     nextCheckpoint =  player.transform.position.z + checkpointIncrement;
     trackController = GameObject.FindObjectOfType<TrackController>();
     killPlane = GameObject.Find("KillPlane");
 }
Beispiel #36
0
    private void Awake ()
    {
        // If instance already exist, destroy ourself.
        if ( instance != null && instance != this )
        {
            Destroy ( gameObject );
            return;
        }
        // No instance exist yet? We are it.
        instance = this;

        // This line exist so that the Singleton would persist between scene loads.
        // Not all singletons needs that.
        DontDestroyOnLoad ( gameObject );
    }
 public void TrackControllerConstructorTest()
 {
     TrackController target = new TrackController();
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
 public void SuggestAuthorityTest()
 {
     TrackController target = new TrackController(); // TODO: Initialize to an appropriate value
     string trackId = string.Empty; // TODO: Initialize to an appropriate value
     BlockAuthority auth = null; // TODO: Initialize to an appropriate value
     bool expected = false; // TODO: Initialize to an appropriate value
     bool actual;
     actual = target.SuggestAuthority(trackId, auth);
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
 public void SetSwitchTest()
 {
     TrackController target = new TrackController(); // TODO: Initialize to an appropriate value
     TrackSwitch s = null; // TODO: Initialize to an appropriate value
     bool expected = false; // TODO: Initialize to an appropriate value
     bool actual;
     actual = target.SetSwitch(s);
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
 public void OpenTrackTest()
 {
     TrackController target = new TrackController(); // TODO: Initialize to an appropriate value
     string trackId = string.Empty; // TODO: Initialize to an appropriate value
     bool expected = false; // TODO: Initialize to an appropriate value
     bool actual;
     actual = target.OpenTrack(trackId);
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
    void Start()
    {
        tc = GameObject.Find("TrackController").GetComponent<TrackController>();
        puzzle = GameObject.Find("PuzzlePanel").GetComponent<PuzzleController>();
        pieceLocked = false;
        //lockLocation = lockedPosition.position;

        // adjusting for width of reticule
        //lockLocation.x -= 40f * .0025f;
    }
Beispiel #42
0
 void Start()
 {
     carRigidbody = GetComponent<Rigidbody>();
     initialRotation = carRigidbody.transform.rotation;
     trackController = GameObject.FindObjectOfType<TrackController>();
 }