Esempio n. 1
0
        public void Validate_StorePlayerDetailsChanges()
        {
            HealthCheckEvidention health = new HealthCheckEvidention();
            Person       player          = new Person();
            Contract     contract        = new Contract();
            Organization org             = new Organization();

            var repository = new Mock <IPlayerRepository>();

            repository.Setup(x => x.UpdatePlayer(player));
            repository.Setup(x => x.UpdateContract(contract));
            repository.Setup(x => x.UpdateHealthCheck(health));

            PlayerProcessor processor = new PlayerProcessor();

            processor.Repository = (IPlayerRepository)repository.Object;

            processor.StoreHealthCheckChanges(health);
            processor.StoreContractChanges(contract);

            repository.Verify(x => x.UpdateHealthCheck(health), Times.Exactly(1));
            repository.Verify(x => x.UpdateContract(contract), Times.Exactly(1));
        }