I was graciously given the code below by sfdcfox, however after spending the night googling for test class walkthroughs I can't seem to figure it out. Would anyone have any resources to share or be able to point a beginner in the right direction for testing this extension class? public inherited sharing class InventoryTransferSheetController {   Inventory_Transfer_Sheet__c record;   public InventoryTransferSheetController(ApexPages.StandardController controller) {     record = (Inventory_Transfer_Sheet__c)controller.getRecord();   }   public void saveChildren() {        update record.Inventory_Transfer_Lines__r;       } }
This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through the resources here and use them to shape more specific questions. To browse all canonical questions and answers, including more unit test resources, navigate to the  tag.  This canonical question is intended to address several classes of common questions by providing a quick summary and links to comprehensive resources:   How do I start writing my first unit test?  How do I unit test this code?  I need help writing this unit test.   Salesforce Stack Exchange looks for detailed, specific questions that the community can help you with, and can't write tests on your behalf. We feel that working with the resources below can help you get started, and we encourage you to make an attempt to write your test and return to SFSE with your specific questions when you encounter challenges you can't resolve.
A and B disjoint, A compact, and B closed implies there is positive distance between both sets How to code around known MMa special-case failures? It is will known that increasing cooling of a metal casting will lead to finer micro-structure which mean higher mechanical properties. If I have 2 molds one is thick copper die ,&amp; second is just thin-walled copper cup or mold cooled by water. which one of them excepted to cool the molten metal i.e. aluminium faster ?   by calculation it seems that copper die have higher cooling power as it has higher thermal diffusivity , but in real life it seems water have more cooling power. I am so confused. How should I setup separate MX records for a subdomain? A thin-walled container of mass $m$ floats vertically at the separation surface of the two liquids of density $ρ_1$ and $ρ_2$  . The whole mass of the container is concentrated in the part of height $h$.  The question is to determine the immersion depth $h'$of the container in the lower liquid if the bottom of the container has a thickness $h$ and an area $S$ and if the container itself is filled with the liquid of density $ρ_1$.    I applied the fundamental principle of the statics on the container  $Balance$ $Sheet$:  The weight of the container ($-mg$)  The buoyancy force applied by the fluid with density $ρ_2$ ($ρ_2gSh$)  The weight of the fluid with density  $ρ_1$  (-$ρ_2gSh'$)  I summed up the forces and set them to zero and find my $h'$  but then  realised that the fluid with density  $ρ_1$  applied also a buoyoncy force on the top of the container , and the fluid with density  $ρ_2$  applied a buoyoncy force on the other fluid.  Where's the problem ? How do rich people guarantee the safety of their money, when savings exceed the FDIC limit? I am curious how a millionaire would guarantee the safety of his money, given that the FDIC only insures up to $250K of an individual's deposits at a bank.  If someone had $3 million that they wanted to put into the bank, would they have to open up 12 different bank accounts and deposit $250K into each one, so that all of his money is insured by the FDIC?  Or is there an easier way to guarantee the safety of all his money? I am not very familiar with databases and the theories behind how they work.  Is it any slower from a performance standpoint (inserting/updating/querying) to use Strings for Primary Keys than integers? Today is the release of Ubuntu 21.04 (Hirsute Hippo). And I can't update to this version. And also I selected ‘Notify me of a new Ubuntu version’ and changed it to ‘For any new version' on the Updates tab on Software &amp; Update, but it's still not working. In addition, in the terminal, I've written: sudo do-release-upgrade -c  And output was: Checking for a new Ubuntu release No new release found.  What should I do? How do I get %LocalAppData% in c#? Consider the following figure from Faraway's Linear Models with R (2005, p. 59).    The first plot seems to indicate that the residuals and the fitted values are uncorrelated, as they should be in a homoscedastic linear model with normally distributed errors. Therefore, the second and third plots, which seem to indicate dependency between the residuals and the fitted values, suggest a different model.  But why does the second plot suggest, as Faraway notes, a heteroscedastic linear model, while the third plot suggest a non-linear model?  The second plot seems to indicate that the absolute value of the residuals is strongly positively correlated with the fitted values, whereas no such trend is evident in the third plot. So if it were the case that, theoretically speaking, in a heteroscedastic linear model with normally distributed errors  $$ \mbox{Cor}\left(\mathbf{e},\hat{\mathbf{y}}\right) = \left[\begin{array}{ccc}1 &amp; \cdots &amp; 1 \\ \vdots &amp; \ddots &amp; \vdots \\ 1 &amp; \cdots &amp; 1\end{array}\right] $$  (where the expression on the left is the variance-covariance matrix between the residuals and the fitted values) this would explain why the second and third plots agree with Faraway's interpretations.  But is this the case? If not, how else can Faraway's interpretations of the second and third plots be justified? Also, why does the third plot necessarily indicate non-linearity? Isn't it possible that it is linear, but that the errors are either not normally distributed, or else that they are normally distributed, but do not center around zero? At most finitely many (Hamel) coordinate functionals are continuous - different proof Is floating point math broken? Start script on open blender file Choosing numbers without consecutive numbers. In how many ways can we choose $r$ numbers from $\{1,2,3,...,n\}$,   In a way where we have no consecutive numbers in the set? (like $1,2$) I am trying to follow the  and . I tried to push some of my Lightning components which depend on a managed package in App Exchange. I would like to know how to install a managed package using Salsforce DX CLI so that i can use that command in my travis.YML file for my CI integration.  Here is the script for my Travis file  sudo: true dist: trusty cache: false env: - URL=https://developer.salesforce.com/media/salesforce-cli/sfdx-linux- amd64.tar.xz before_install:  - export SFDX_AUTOUPDATE_DISABLE=true - export SFDX_USE_GENERIC_UNIX_KEYCHAIN=true - export SFDX_DOMAIN_RETRY=300 - wget -qO- $URL | tar xJf - - "./sfdx/install" - export PATH=./sfdx/$(pwd):$PATH - sfdx update - sfdx force:auth:jwt:grant --clientid $CONSUMERKEY --jwtkeyfile  assets/server.key --username $USERNAME --setdefaultdevhubusername -a DevHub script: - sfdx force:org:create -f config/project-scratch-def.json -s -a  PackageInstallation - sfdx force:org:list - sfdx force:org:display - sfdx force:user:password:generate -u PackageInstallation - sfdx force:org:display - sfdx force:org:open -u PackageInstallation - sfdx force:source:push -u PackageInstallation - sfdx force:apex:test:run -u PackageInstallation -c -r human   I get the following error as my components depend on the app exchange components:     No COMPONENT named markup://ldt:datatableDev found : Iterating over Java collections in Scala I'm writing some Scala code which uses the  API. I would like to iterate over the rows contained in the java.util.Iterator that I get from the Sheet class. I would like to use the iterator in a for each style loop, so I have been trying to convert it to a native Scala collection but will no luck.  I have looked at the Scala wrapper classes/traits, but I can not see how to use them correctly. How do I iterate over a Java collection in Scala without using the verbose while(hasNext()) getNext() style of loop?  Here's the code I wrote based on the correct answer:  class IteratorWrapper[A](iter:java.util.Iterator[A]) {     def foreach(f: A =&gt; Unit): Unit = {         while(iter.hasNext){           f(iter.next)         }     } }  object SpreadsheetParser extends Application {     implicit def iteratorToWrapper[T](iter:java.util.Iterator[T]):IteratorWrapper[T] = new IteratorWrapper[T](iter)      override def main(args:Array[String]):Unit =     {         val ios = new FileInputStream("assets/data.xls")         val workbook = new HSSFWorkbook(ios)         var sheet = workbook.getSheetAt(0)         var rows = sheet.rowIterator()          for (val row &lt;- rows){             println(row)         }     } } IPv4 vs IPv6 priority in Windows 7 I have IPv6 connectivity through Hurricane Electric tunnel. Since IPv6 day this year, many services (google.com, facebook.com, etc.) enabled IPv6 on their main domains. On my Windows machine, IPv6 is preferred over IPv4. This means that whenever I visit Google, all traffic goes through my tunnel to Hurricane Electric, which raises the latency by more than 100%:  C:\&gt; ping www.google.com  Pinging www.l.google.com [2001:4860:8005::68] with 32 bytes of data: Reply from 2001:4860:8005::68: time=85ms Reply from 2001:4860:8005::68: time=84ms Reply from 2001:4860:8005::68: time=112ms Reply from 2001:4860:8005::68: time=86ms  Ping statistics for 2001:4860:8005::68:     Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:     Minimum = 84ms, Maximum = 112ms, Average = 91ms   C:\&gt; ping -4 www.google.com  Pinging www.l.google.com [173.194.79.103] with 32 bytes of data: Reply from 173.194.79.103: bytes=32 time=28ms TTL=48 Reply from 173.194.79.103: bytes=32 time=28ms TTL=48 Reply from 173.194.79.103: bytes=32 time=55ms TTL=46 Reply from 173.194.79.103: bytes=32 time=29ms TTL=46  Ping statistics for 173.194.79.103:     Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:     Minimum = 28ms, Maximum = 55ms, Average = 35ms   Question: How can I make Windows 7 to always prefer IPv4, when both IPv4 and IPv6 records are available for a specific domain name? What are the different ways I can use to upgrade Ubuntu from one release to another? Could there be a body of water the size of a planet? Determinant of a specially structured matrix ($a$'s on the diagonal, all other entries equal to $b$)